WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
WordPress SEO Yoast - Duplicate Site Title (4 posts)

  1. RChiiton
    Member
    Posted 1 year ago #

    I've seen a post regarding this but there were mixed reviews on what fixed the problem. I do not want to change out one piece of code to fix one problem but gain a different one. The code in my theme is:

    <title>
    <?php if (is_home()) {
    	echo bloginfo('name');
    } elseif (is_category()) {
    	echo __('Category » ', 'blank'); wp_title('« @ ', TRUE, 'right');
    	echo bloginfo('name');
    } elseif (is_tag()) {
    	echo __('Tag » ', 'blank'); wp_title('« @ ', TRUE, 'right');
    	echo bloginfo('name');
    } elseif (is_search()) {
    	echo __('Search results » ', 'blank');
    	echo the_search_query();
    	echo '« @ ';
    	echo bloginfo('name');
    } elseif (is_404()) {
    	echo '404 '; wp_title(' @ ', TRUE, 'right');
    	echo bloginfo('name');
    } else {
    	echo wp_title(' @ ', TRUE, 'right');
    	echo bloginfo('name');
    } ?>
    </title>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

    Wondering what it should be so no duplicate title appears but it does not affect anything else.

    thanks for the help.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. RChiiton
    Member
    Posted 1 year ago #

    As a note. What is appears to be doing is adding the "site title" to the end of the title that you put in the yoast SEO. It only happens on the "Home" page. I am using the dandelion theme from Theme Forest and it happens on every site that I use that theme. I tried changing the title code to just this

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

  3. RChiiton
    Member
    Posted 1 year ago #

    Oopps pressed send to soon. Changing code to the above made no change in the way the site title appeared.

  4. andamira
    Member
    Posted 1 year ago #

    Had the same problem.

    My solution was to comment the lines
    echo bloginfo('name'); everywhere except inside is_home() and is_search(), resulting like this:

    <title>
    <?php if (is_home()) {
    	echo bloginfo('name');
    } elseif (is_category()) {
    	echo __('Category » ', 'blank'); wp_title('« @ ', TRUE, 'right');
    	// echo bloginfo('name');
    } elseif (is_tag()) {
    	echo __('Tag » ', 'blank'); wp_title('« @ ', TRUE, 'right');
    	// echo bloginfo('name');
    } elseif (is_search()) {
    	echo __('Search results » ', 'blank');
    	echo the_search_query();
    	echo '« @ ';
    	echo bloginfo('name');
    } elseif (is_404()) {
    	echo '404 '; wp_title(' @ ', TRUE, 'right');
    	// echo bloginfo('name');
    } else {
    	echo wp_title(' @ ', TRUE, 'right');
    	// echo bloginfo('name');
    } ?>
    </title>

    this works for me

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic