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>
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>
0 comments:
Post a Comment