Remove Double Titles in WordPress

Hack or Fix 330 views
+2
0 Flares 0 Flares ×

Generally the following two plugins have issues with double titles within Google search:

WooCommerce
WordPress SEO Yoast

In order to remove the double title you will need to open the header.php file and look for the <title> tag. It can look pretty much different from theme to theme but usually you will find some code inside like this:

<title>
    <?php $the_title = wp_title('', false);
        if ($the_title != '') :
            echo wp_title('',false),' | '; bloginfo('name');
        else :
            bloginfo('name');
            if ($paged > 1) { echo ' - page '.$paged; } else { if ($blogdesc=get_bloginfo('description')) echo ' - '.$blogdesc; }
        endif; ?>
    </title>

Replace everything betweenandtags with this code:

<title> <?php wp_title(''); ?> </title>

That should fix it. Note that it takes time for Google to re-crawl your page and re-index the proper title, so be patient.

Provided by: Fivera
Posted in Wordpress

Discuss:

2 comments on “Remove Double Titles in WordPress
  1. Thank you for featuring this snippet from fivera.net
    One juicy link pointing to your wonderful website has been added to the actual post itself.Cheers.

  2. Syed Zain says:

    Great work… i love to read codes from this site.. and reading such content has become my new hobby now a days.. keep it up.

1 Pings/Trackbacks for "Remove Double Titles in WordPress"
  1. […] This snippet is featured at SnippetCentral.Com […]

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  1. […] This snippet is featured at SnippetCentral.Com […]

Login

Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×