Pages

Friday, September 30, 2011

7

Fix Blogger post and page titles

Now that Google finally begun indexing this site, I remembered the page <title>'s. And that they are not to my liking in Blogspot.

Default Blogger page titles are like this:

main page: YourBlogTitleWhichCanBeVeryLongInSomeCases
a page: YourBlogTitleWhichCanBeVeryLongInSomeCases: A Page
a post page: YourBlogTitleWhichCanBeVeryLongInSomeCases: A Post
archive page: YourBlogTitleWhichCanBeVeryLongInSomeCases: September 2011

Imagine those titles in Google search, or better still, on browser tabs or operating system's taskbar. Hard to differentiate one from the other! Better titles would be, at least I think:

main page: YourBlogTitleWhichCanBeVeryLongInSomeCases
a page: A Page | YourBlogTitleWhichCanBeVeryLongInSomeCases
a post page: A Post | YourBlogTitleWhichCanBeVeryLongInSomeCases
archive page: September 2011 | YourBlogTitleWhichCanBeVeryLongInSomeCases

This way the important information is first. Luckily the fix is simple: Edit template html. Find line:

<title><data:blog.pageTitle/></title>

and replace it with:

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

Save template and test. Now index-type (index and search) pages keep old titles, others get new titles. You can use other characters instead of   |  there, and more characters than one, too. If you could not make it, please read know your way around.
[Hide comments] - [Show comments]
Click on a single comment to hide/show its text

7 comments:

Ariel said... [reply]

Good post, and what do you think about adding description to each post? Would It be better for SEO?

MS-potilas said... [reply]

@Ariel
I'm really not much into the SEO stuff, but I understand that nowadays metas are not so important for search engines as they used to be, they were misused alot etc.

In this blog I did not add meta description, but in my MS-potilas blog I added meta description, meta author and meta keywords for index pages of the blog. I did not find a good way to use post variables for metas in <head> in post pages, and if you use the same decription for all posts, at least Google webmaster tools complain about that, so maybe it is not good. That's why I added those metas only to index pages.

Ariel said... [reply]

Thanks for replying MS-potilas, I always aprecite the opinion of others about doubts I have

You always make good and interesting articles, bye and thanks again

Jenson said... [reply]

Many thanks for providing this tutorial. We all have this problem with our blogs.

priya said... [reply]

PHP course in Chennai, giving real-time training from beginner to advanced level programs with project-based training. The PHP course syllabus is hand-crafted by industry experts, and we adhere to the syllabus with latest technologies based on current industry demands across various disciplines.
PHP Institution in Chennai
PHP developer in Chennai
PHP mysql course in chennai

Post a Comment

Related Posts Plugin for WordPress, Blogger...
See the hack
for this dynamic
views icon: