Reformatting wp_title()
As you all know WordPress generate its pages with matching titles according to the page contents. It uses the wp_title() tag to accomplish this simple task.
Now in search of a better way to boost our pages for search engine optimization, I decided that the original format that comes with WordPress is a little obsolete:
< ?php bloginfo('name'); ?> < ?php if ( is_single() ) { ?> » Blog Archive < ?php } ?> < ?php wp_title(); ?>
This prints the blog’s name first, then adds the words “Blog Archive” and finally prints the most crucial part of the equation, the post title.
I decided to print the post title first, so that Google would have the keywords in it indexed first, not last. So here’s what I did:
< ?php wp_title(''); ?>< ?php if ( is_home() ) { } else { ?> - < ?php } ?>< ?php bloginfo('name'); ?>
It’s not rocket science but I believe this will help boost your SEO as Google will find your permalinks and WordPress generated pages with its title first instead of your blog name.
PS: This won’t affect your front page as it doesn’t have any post titles on it.
May 1st, 2006 at 1:35am
Genius. Pure genius!
May 1st, 2006 at 1:43am
The code or the idea?
May 1st, 2006 at 4:34am
The idea, i’m using it on my site
January 16th, 2007 at 10:10am
Thanks for the great tip. I implemented it at my sites.