Rebeccas Workbench: The Pet Projects of Rebecca OConnell

Instructional Materials

Sunday, July 13, 2008

Changing Blogger Titles from "Blog Title: Label/Page Title" to "Label/PageTitle: Blog Title"

By default, Blogger displays titles "Blog Title: Label/Page Title." This is suboptimal from a Search Engine Optimization (SEO) perspective. Plus, it's just good practice to put the most important information first in a title. You probably didn't come her just to see "Rebecca's Workbench." No, you want to make Blogger behave in the desired manner.

Attempts to Make Blogger Behave in the Desired Manner

I found a number of pages with instructions on how to make blogger display page titles in the "Label/PageTitle: Blog Title" format, but none of them seemed to work for me. Additionally, when they do (or did) work, some of them required that the title be positioned outside of the head tags and were reported to break certain Blogger customization features.

I found that one problem I was having was that the most frequently cited technique involve using the if conditional "<b:if cond="'data:blog.pageType">." After some investigation, I discovered that label summaries return type "index," just like the blog's home page. This meant that the conditional didn't work for me. So I changed the conditional to see if the blog's page name is an empty string, as it is for the home page, but is not for both individual blog posts and label summaries.

Another problem I had was finding the data tag I needed to display the blog's title without the trailing ": Post/Label Name," resulting in "Post/Label Name: Blog Name: Post/Label Name." the magic data tag is "&ltdata:blog.title> (found at BLOGFixes.Com). So, to sum up, Blogger's title data tags (that I know of) are:

  • <data:blog.pageTitle/>: "Blog Title: Blog Page Name (the title of a post or the label)"
  • <data:blog.title/>: Just the Blog's Title
  • <data:blog.pageName/>: Just the Blog's Page Name

How to Change the Page Title

At last, I found a solution. As far as I can tell, this solution should not break any of Blogger's features. However, the blogs I am using it on all use a large amount of custom code, so it is difficult for me to tell. I know that it works for me. I hope that it works for you. If it doesn't, please leave a comment telling us what went wrong.

To change the page title:

  1. Using your dashboard, go to "Edit HTML" in the "Layouts" section.
  2. Back up your template. You can do this by clicking the "Download Full Template" link at the top of the page.
  3. Replace the code "<title><data:blog.pagetitle/></title>" with the code in the code block below. This line of code is near the top, just inside the head tag (or you may be able to just search for it).
  4. Click the "Save Template" button at the bottom of the screen. A yellow banner should appear at the top stating that "Your changes have been saved," and inviting you to "View Blog."

The Code Block

<b:if cond='data:blog.pageName == &quot;&quot;'>
<title><data:blog.title/></title>
<b:else/>
<title><data:blog.pageName/>: <data:blog.title/></title>
</b:if>

9 comments:

  1. I am already using this hack for sometimes now and it works fine. What I wanted to do further was to have title for my 'label' pages as well which unfortunately I failed to achieve. I wanted the label name to appear in the page title when viewing label or category pages. Shed some light on this one if its possible.

    ReplyDelete
  2. nice post.
    it works.
    thanks for posting.

    ReplyDelete
  3. Really great tips, searching to achieve what Kashif mentioned, is it possible to get label name in title for label pages? That would really improve SEO.

    ReplyDelete
  4. Due to that a crisp molded business can make an area in this online business. A SEO organization offers the whole SEO administrations to help in the positioning of an online business with the administration of their web showcasing plans. avg website scanner

    ReplyDelete
  5. Extended projections can go with the additional accomplishment in business in light of the fact that the damaged of this claim drives the online business site to its end.Yahoo discount

    ReplyDelete
  6. Thank you, this one actually worked but I had to delete < title > and < /title > around the things that had to be titles (:D)

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Please make it like this

    Home>label>post-title









    https://www.filmyzila.site

    ReplyDelete