WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Duplicate title when Yoast SEO plugin is active (17 posts)

  1. TimmyDee
    Member
    Posted 2 years ago #

    I'm getting an extra site title tacked on to the end of my title tag when the Yoast SEO plugin is active. Deactivating the plugin removes it. Not sure where this is creeping in—I don't have anything changed from the default title settings. Seems like it could be a bug.

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

  2. JL
    Member
    Posted 2 years ago #

    I'm getting
    'post title - blog name'
    and I don't need the 'blog name' part because that's put in through my Thesis theme as
    'post title | blog name' so I delete it each time manually.
    Now, if it stopped there it would be OK, but I see in the search engines it's also added the site name. Although I don't see it in the Admin area, I'm now being indexed as
    'post title | blog name - site name'.
    Not good. Can anyone please tell me how to get rid of the 'site name' part of it?

  3. Rain into Rainbows
    Member
    Posted 2 years ago #

    Same error here as well. It took me awhile to figure it out. I posted about it here. I really love the plugin but have had to disable it until this can get worked out.

    Would love to hear when there's a solution.

  4. Peter Wooster
    Member
    Posted 2 years ago #

    I had the same problem, it was that the theme was adding the site name and other stuff to the title. Your theme's header.php must be as described in the titles section of the seo admin:

    Be aware that for WordPress SEO to be able to modify your page titles, the title section of your header.php file should look like this:
    
    <title><?php wp_title(''); ?></title>
    If you can't modify or don't know how to modify your template, check the box below. Be aware that changing your template will be faster.

    I changed that in my custom theme (based on ToolBox) and it worked properly.

    /peter

  5. JL
    Member
    Posted 2 years ago #

    What's confusing me about that is that my header.php presently looks like this:

    <?php
    
    function thesis_header_area() {
    	thesis_hook_before_header();
    	thesis_header();
    	thesis_hook_after_header();
    }
    
    function thesis_header() {
    	echo "\t<div id=\"header\">\n";
    	thesis_hook_header();
    	echo "\t</div>\n";
    }
    
    function thesis_default_header() {
    	thesis_hook_before_title();
    	thesis_title_and_tagline();
    	thesis_hook_after_title();
    }

    Am I supposed to delete all that and put this instead?

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

    It seems to me something is going to go seriously wrong with that.

  6. liliie
    Member
    Posted 2 years ago #

    If you are using Thesis to manage your titles you need to remove the WordPress SEO by Yoast title action with the following code. Paste this into your custom_functions.php

    remove_filter('wp_title', array($wpseo_front, 'title'), 10, 3);

  7. macjoost
    Member
    Posted 2 years ago #

    I also think it's a bug. The plugin does not seem to honor its own "Force rewrite titles" setting.

    Above suggestion is a good workaround.

    In the plugin code, the __constructor function of WPSEO_Frontend needs to be changed so that add_filter( 'wp_title' ... ) is only run when 'forcerewritetitle' is ON.

  8. garotog
    Member
    Posted 2 years ago #

    Installed 1.1.5. version on WordPress 3.3.1. but I am confuse with the title settings on my header.php. I notice repetitive titles in some pages, example:

    Title is showing as:
    <title> Marina District - Downtown San Diego Real Estate | Condos & Lofts - San Diego Real Estate </title>

    Instead of showing:
    <title> Marina District - Downtown San Diego Real Estate | Condos & Lofts</title>
    which is what I have on 'SEO Title' under the page edit ('Snippet Preview' shows the same).

    Do I need to change my title on my header.php to <title><?php wp_title(''); ?></title> when I currently have :

    <title>
    <?php if (function_exists('is_tag') && is_tag()) {
    single_tag_title('Tag Archive for "'); echo '" - ';
    } elseif (is_archive()) {
    wp_title(''); echo ' Archive - ';
    } elseif (is_search()) {
    echo 'Search for "'.wp_specialchars($s).'" - ';
    } elseif (!(is_404()) && (is_single()) || (is_page())) {
    wp_title(''); echo ' - ';
    } elseif (is_404()) {
    echo 'Not Found - ';
    }
    if (is_home()) {
    bloginfo('name'); echo ' - '; bloginfo('description');
    } else {
    bloginfo('name');
    } if ($paged > 1)
    { echo ' - page '. $paged;
    } ?>
    </title>

    Any assistance will be greatly appreciated.

  9. spsmw
    Member
    Posted 2 years ago #

    liliie, thanks for the remove_filter code. That did the trick. Joost, is this a big with the plugin? As others have mentioned, unchecking "force rewrite" for the title doesn't fully stop messing with wp_title.

  10. macjoost
    Member
    Posted 2 years ago #

    Hi spswm,

    I'm not using the plugin anymore, so I don't know if anything has changed. At the time it was a bug in the plugin.

  11. JaySilver21
    Member
    Posted 2 years ago #

    I had the same problem, but then removed the %%sitename%% from the post title template and the pages template and now it's fine.

  12. RichardWantsToKnow
    Member
    Posted 2 years ago #

    I just wish he would take the time to write some decent documentation. What he does provide in the dashboard, his site and the tour is grossly lacking. Many times it's simply a restatement of the label on an option. Other times (the majority) I can only assume that he believes that since he understands what the selection or option does, that everyone knows what he is intending.

  13. shadez
    Member
    Posted 1 year ago #

    probably you might find this in your header.php:
    bloginfo( 'name' );
    commenting it out should remove the trailing title.

    i think this cant be called as a bug. i think the author has coded to generate wp_title, but some themes append bloginfo() to it, some dont. so...

    for custom homepage title changes, you will have to edit the page title directly from editor.
    another tip is to manually hardcode metadata into header. some other plugins like all-in-one-seo has a seperate settings panel for it but not this...

  14. Dave333
    Member
    Posted 1 year ago #

    I've got the same problem with duplicate titles caused by this plugin. Uninstalling the plugin did the trick.

    Documentation would be very helpful. Without instructions on how to use it, all the work creating the plugin is wasted.

  15. zafariqbal
    Member
    Posted 1 year ago #

    The Perfect Solution is This
    Please Replace this code with your in the Header.php Title.

    Note Code has already <title> tags
    you do not need to insert it in the <title></title> tags

    Code Documentation.
    if your yoast plugin is deactivate so it will comeback to your previous title settings(changes).

    You Just need to set %%title%% | %%sitename%% in the Yoast Seo Post/Pages Titles.

    <?php
    	/*
    	 * Print the <title> tag based on what is being viewed.
    	 */
    global $page, $paged;
    
    // if Plugin Activate
    	if ( ! function_exists('is_plugin_inactive')) {
        require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    	}
    
    	if ( !is_plugin_inactive('wordpress-seo/wp-seo.php') ) {
    
    // if Force Rewrite is Active
    		$options = get_wpseo_options();
    		if ( isset( $options['forcerewritetitle'] ) && $options['forcerewritetitle'] ) {
    		}else{ ?>
    <title>
    	<?php wp_title( '' );
    
    	// Add the blog name.
    	//bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );	?>
    </title>
    
    <?php }
    	}else{ ?>
    <title>
    <?php wp_title( '|', true, 'right' );
    
    	// Add the blog name.
    	bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
    ?>
    </title>
    <?php } ?>
  16. pizzaboy2000
    Member
    Posted 1 year ago #

    Used wp_title and it fixed it for me. Thanks

  17. BooksForeverOH
    Member
    Posted 1 year ago #

    I had the same problem, but then removed the %%sitename%% from the post title template and the pages template and now it's fine.

    Worked for me. Thanks JaySilver21

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic