Tuesday, 21st May 2013

«

»

Print this Post

Fix: “WordPress SEO by Yoast” prints site title twice

If you are using “WordPress SEO by Yoast” plugin, then you may have noticed that it prints the site name two times in page title. For example, if the site name is MY BLOG, then it prints “post title – MY BLOG – MY BLOG“. This is a common issue in hard coded themes. They do not simply cooperate with the plugin. This can be fixed by replacing title generator code in your theme’s header.php file with <?php wp_title(''); ?>

First, go to WordPress SEO titles settings and uncheck Force rewrite titles. Then open up header.php file of your theme and search for <title>. Then replace whole <title>some code</title> with <title><?php wp_title(''); ?></title> and update file. This should fix your problem. Now go back to your site and make sure that site name in title is displaying only once. I faced the same problem, and fixed it by doing the above hack.

Update:

Fixing this issue in Graphene Theme is even easier. Go to Graphene Options –> Display –> Miscellaneous Display Options –> Site title options and just put #post-title in Custom content pages site title.

If you are comfortable with child theme and php, you may add this function to graphene child theme’s functions.php file.

function my_remove_filter(){
   remove_filter( 'wp_title', 'graphene_title' );
}
add_action( 'init', 'my_remove_filter' );

This disables Graphene theme’s ability to modify post titles. This is a much better solution.

Short Link:

About the author

Prasanna SP

Student | WordPress Dev | Tech Blogger | Interested in GNU/Linux, FOSS, php, Drupal, Wordpress, Ethical hacking, Photography, Painting, Literature etc..

31 comments

2 pings

Skip to comment form

  1. Rajesh Kumar

    Hi Prasanna,

    Iam using WP Clear theme and facing problem like post title – sitename : sitename. how to fix this problem??

    1. Prasanna SP

      There may be an option to change the title structure in your theme options. Look for it, if there is no, then try the above hack.

  2. vijay

    Hey,you helped me to fix this issue.thanks alot

    1. Prasanna SP

      You are welcome Vijay!

  3. simran

    hey i just followed your steps but didn’t find it useful as i share my content on google+ its still showing doule title here are attchments for better vision:
    After activating plugin and modifying header:
    https://dl.dropbox.com/u/37329086/sfdfsd.PNG

    Before activating:
    https://dl.dropbox.com/u/37329086/sdfsd.PNG

  4. Satish

    Thank you very very very very very very very very very very very very much :D

    Actually first i copied what you mentioned above :) But later i saw that the same code was shown in post title as a code.. Later again i released that i there are no proper spaces in the code. so copied and resolved my problem with yoast :D

    so its not
    in the first para. Its
    without space and all

    any how thanks for the tip mate :D

    1. Prasanna SP

      Thanks for the notification Satish! I’ve removed the space from wp_title code and updated the post.

      1. Satish

        Cool Dude :) Thank you very much again :)

  5. Pixxel Media

    Saved one of my blogs using this tip. Thank you so much Prasanna SP. It was super easy and informative.

  6. Juan

    Thanks

  7. evan

    Awesome, worked great. No more double sitename titles for me. Thanks!

  8. Jan

    Though this post is a little old, it could help me!
    Thank you Prasanna!

  1. Pixxel Media | Graphic Design | Website Development » Wordpress SEO Plugin worth checking out

    [...] we went hunting around the web and finally found the WordPress Seo Plugin double title fix.  The blog is not very pretty but it tells you exactly how to fix the problem.  In a summary, it [...]

Leave a Reply

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

Please put your code snippet between <code> and </code>. Comment moderation is in use. Please do not submit your comment twice -- it will appear shortly.