Wednesday, 22nd 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. leonor

    Hi, I did this but it didn’t fix…i still have the title doubled…

    can you help?

    1. Prasanna SP

      Hi eonor, which theme you’re using in your site?

  2. nautilus7

    This doesn’t work here too. Graphene theme v1.6 and v1.1.5 of the seo plugin.

    1. Prasanna SP

      Yeah, it was working earlier, but now Graphene theme itself is using <title><?php wp_title(''); ?></title> for the title. I don’t know what went wrong after the 1.6 update!

    2. Prasanna SP

      Hi nautilus7,
      I’ve fixed this issue by another way. I changed the Custom content pages site title (Graphene Display Options –> Miscellaneous Display Options –> Site title options) to #post-title » Blog. So, it shows page title as “Post Titile – Prasanna SP » Blog”. It is much better than having double site name. I hope this could help you too.

  3. Tanya Demjanec

    Hello Prasanna.

    Came across your site today searching for a solution.

    Now I think you may have a theory!

    Do you think you may know why it is, that when I click on the RSS icon in the top of my site, it directs me to Add to Google page (which is fine), but the NAME of the feed is

    Car Wash AtlantaCar Wash Atlanta »
    Kirkwood Car Wash, Atlanta’s Self-Service Car Wash
    http://carwashatlanta.com/feed

    Where “Car Wash Atlanta” is obviously listed twice. Not neatly, I might add.

    Any thought on how I could remedy this? Within which file is that title being written? I don’t really want to make any global changes that will affect other page/post titles.

    It’s showing up strangely in search results and it’s bugging me!

    I’m using Graphene theme, which overall I like very much.

    Thank you in advance and best to you,

    -Tanya

    1. Prasanna SP

      Hi Tanya, to fix the feed title issue, replace the contents of /graphene/includes/theme-head.php with this updated one – http://graphene.googlecode.com/svn/branches/1.6/includes/theme-head.php

      Else, you can wait for the Graphene 1.6.1 maintenance release. It has the fixes for known bugs.

      Thank you for visiting my site!

      1. Tanya Demjanec

        Thanks!

        I downloaded the new file and replaced the old theme-head.php.
        That did the trick of removing the double title smushed together — but it then appeared without any title at all!

        I couldn’t figure out how to modify the original theme-head.php, but this version seemed quite clear.

        I swapped out a line for the title so that it shows up PERFECTLY!

        	if ( is_feed() ){
         
        		/**$title = $default_title;*/
        		$title = $graphene_settings['custom_site_title_frontpage'];

        Thanks again. Looking forward to your next post!

        Best,

        -Tanya

        PS to nautilus7: Thanks for chiming in, but I was solely concerned with the way the title appeared for the feed page. Everything else I had working just as I like and I didn’t want to alter that.

  4. akhil

    Thnks man….you helped me

    1. Prasanna SP

      Thanks for the comment Akhil.

  5. Bryan Rego

    Thanks friend.. i had the problem on my sites techspins.com and mbascholar.com…. thaanks for the write up. i could not figure it out. Great tip friend.

    1. Prasanna SP

      Thanks Bryan!

  6. Chris

    I am having this same problem. I have Thesis 1.82 theme but the header.php file that I edited the title on is from my root wordpress directory because in the thesis themes header.php there’s only a couple of lines.

    Did I edit the right file ? Because it still appends the site name twice after my post name… :(

    1. Prasanna SP

      Hi Chris, I haven’t seen the structure of Thesis theme. So, I don’t know where the title is coming from. If it it not there in header.php (in root) look for the header files in /includes.

      1. Chris

        I have fixed it, turns out there is an option in the thesis settings to append the site name to page titles which I had switched on!

  7. Christian

    Thank you my friend for your excellent information. It has been very useful for me in different articles.
    I have a problem with the Double Titles being generated using the SEO plugin. I am using the Graphene theme and I already have the “title” as it should be in my header.php.

    Although I still have the problem. I wonder if I need to change something else in the graphene settings???

  8. Mark

    Hi, I don’t have double titles in my site’s title… but in my RSS. I disables all SEO option of the theme, only active SEO plugin is Yoast… and I still can’t figure out where the problem is exactly coming from. :(
    Do you have any idea?

    1. Prasanna SP

      This issue is fixed in the latest version of Graphene theme. Please update yours.

  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.