Create a perfectly SEO optimized title tag for wordpress

The solution to this problem is to modify the way your WordPress theme displays the title tag.
1 . To do so, open the header. php fle from your theme. The code used to generate the title tag might look like this:

<title>
<?php bloginfo(' name' ) ; ?>
<?php if ( is_single( ) )
 { 
?>
»Blog Archive
<?php 
}
?>
<?php wp_title() ; ?>
</title>

2. Once you have found it, replace it with the following:

<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>

3. Save your header. php fle. The modifcation has been made and your titles are now SEO-friendly.

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.