How to Make Your Title Tag SEO Friendly

Wordpress title tag also plays important role in SEO, it telling the search engine spider what your site covered, and allows your site to be indexed based upon the correct and most relevant keywords. If your site has good seo, then you will have lots of organic traffic from various search engines. So how to make your wordpress title tag SEO friendly?

Open header.php file, find the <title> tag, and replace it by the following code.

<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() ) {
bloginfo(’name’); echo ': '; single_post_title();
} else {
wp_title("",true);
} ?>
</title>

This code will generate title tags according to the following model:

  • Blog homepage -> display blog name.
  • Category page -> display the category name and the blog name.
  • Article page -> display the article title.
  • Static page -> display the blog name, and the page title.

Leave a Reply