Friday, June 13, 2008

Functional! Swap Blog Name And Post Title On Blogger, Does Not Break Theme XML

"Working Swap Blog Name And Post Title On Blogger, Does Not Break XML".

It has been argued that from a SEO point of view, it is better to have the post title appear as the page title instead of a generic blog title first. You get noticed on search engines easily and your pagerank may go up. What ever the reason it looks neat and cleaner. Like for an instance, this article would appear;

"Geemodo : Working Swap Blog Name And Post Title On Blogger, Does Not Break XML."
on search engine results. That is fine in the beginning to get your blog name out. But once it has been established, your want your articles to have prominence in search results. So swapping blog name and post title became a challenge for Blogger, blogpost users. Earlier there were widgets that allowed smoother operations of this task and later those failed due to changes made at Blogger, the new blogger. Imagine if you have a name like "MyAdlets, The Viral Frontier", you article name get lost behind the Blog name!
I have been searching the internet for a solution and had multiple versions of this code hack saved. I tried them all, until I came across the following. I am not sure of the author but I am sure it is not me! ;). The other solutions that I tried broke the template XML and made a mess of the layout if you were to add new elements.
I tried this at MyAdlets and it is working fine.

To get working, you need to do some hacking on your template. Login to your Blogger account, select layout tab.
Within Layout tab select "edit html" and click on the "Expand Widget Templates" check box. To be safe I alway save my template by selecting "Download Full Template", so that I can go back if I make a mistake. I strongly advise you to do so as well.

Find (If you are using Firefox, select Edit -->Find in This Page | and cut and paste the following)



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

and replace it with the following;

<!-- Swap Blogger Name-Title change -->
<b:if cond='data:blog.pageType == "item"'>
<title>
<data:blog.pageName/> | <data:blog.title/>
</title>
<b:else/>
<title><data:blog.pageTitle/></title>
</b:if>
<!-- End of wap Blogger Name-Title change -->

You are done, save the changes, view the blog.
Now you can make a post and see how search engine bots see your post! Now the name and the title is always swapped.

Warning, as with all advise, it is a risk that you make a mistake and mess up your blog. We take no responsibility for any loss that happens by following these instructions. We have actually tested the method and have positive results. If you are not at ease, contact an expert!

6 comments:

dfg said...

I love you. Been looking for this haha thanks!

ravenII said...

glad it was useful

UgY said...

Thanks for the good tips. This is what I've been looking for.

Savannah said...

Thanks a million, this editing tip worked like a charm.

ravenII said...

Thanks everybody. I will look forward to more articles like this then!

Unknown said...

Thanks for posting this wonderful tip and i am sure this will used by most of the users online.

Cert paper