Some time ago I wrote a post titled “Keep your Title Tags short and pertinent“ÂÂ outlining the best practices for Title tags. Most blogging platforms come with a standard Title tag structure that places the blog name and post title on single post pages. Suppose you have the “ABC Blog” and you just published a post called “Top 10 Firefox extensions”. In that case your Title tag for that single page would be “ABC Blog – Top 10 Firefox extensions”.
This Title structure is good but not optimal. The best possible Title tag for a single blog post is the title of the post alone. The name of the blog will increase the number of keywords (reducing the value of each one) and it might not be related to the post content at all.
Below you will find the code that I use for my Title tag. This code will display the blog name on the home page, the post title on single post pages and the blog name plus category name for category pages.
<title><?php if (is_home () ) { bloginfo(‘name'); }
elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo(‘name'); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(‘',true); } ?></title>
I’ve been using Atahualpa’s SEO options page for this. Very handy theme.
I just got an email in my inbox talking about search engines and title tags and how to optimize them but I wasn’t sure how to do it in WP till I googled “where is my title tag in wordpress” and came across your article here.
Thank you for this wordpress titletag code.. just used this on my blog and it is working perfect. The ‘archives’ and the ‘author ‘ section do not show any title tag, but that’s ok, not a big deal. Thanks again.
A really great tip! It has improved my SEO rankings!
Thanks for this code, I got it to work but only if I take away the title closing tag I am not sure why it doesn’t work when the closing tag is there.
Just use “all-in-one-seo-pack” plugin for WordPress blog.
It let you configure the title dynamically.
CHECK OUT A NEW BLOG…WWW.KOOLSTER.NET
SHARE YOUR IDEAS ABOUT SOCIALLY RELEVANT THINGS!
Thanks just what I was looking for.
Hi there,
Programlar, from my experience the optimal title tag for the homepage is just the blog name.
What about page title? It will display your blogs name only without any information about the page with the code above.
Sorry, last comment post removed the HTML
Fixing Daniels above code snippet, the answer to Vincent and my question would be:
I second what Vincent asks? What about page title? For example your about page should read ‘About’, ‘Daily Blog Tips – About’, or some permutation of the sorts.
What about page title? It will display your blog’s name only without any information about the page with the code above.
Very nice. I’ve never really though about keywords being diluted by my page title. I’ve just implemented this on WallerBlog.com Thanks for the tip!
John, dont forget to use Jeromes keywords to produce a dynamic Meta Keywords tag. It works really well.
That is a really great tip. I use a plugin called “Jeromes Keywords” for all of my posts. Your code piece will make a nice addition. Thank you.
Lionel, yeah you can insert that line to get the name automatically, but I left the written name cause I also experimented with different descriptions and combinations to see what would work best.
I wrote sth similar on opn wp
I am using SEO Title Tag plugin for wordpress and it pretty much does the same thing. I’d much rather use the code above.
Great tip! If you change your “echo ‘Daily Blog Tips’” above to bloginfo(‘name’), you can help people be more lazy and just copy and paste. Like this: