Yoast WordPress SEO double title fix

If you are getting a double title appear in the tab of your browser as you hover over it, there is a good chance that it’s because you have WordPress SEO by Yoast installed. Often just ticking the box ‘Force overwrite titles’ (from the Titles and Metas section on the General tab) will suffice, but I have seen this on many customer themes where it doesn’t work and usually gives the address as a simple URL. Not great for SEO!

Here’s the fix. Look in your WordPress theme files for header.php and then open it in Notepad or ideally Notepad++. Now look for this line or similar (it differs from theme to theme):

<?php wp_title('|',true,'right'); ?>
<?php bloginfo('name'); ?>

Now replace it with:

<?php wp_title(''); ?>

Upload this file to your WordPress theme, overwriting the existing header.php.

Make sure the ‘force overwite titles’ is still unticked. Save your changes and empty any caches you have, eg W3 Total Cache. Check your category titles and post/page titles and they should be fixed!

 

Leave a Reply

Your email address will not be published. Required fields are marked *