WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] remove canonical tags in header (10 posts)

  1. Hans-Joachim Brosch
    Member
    Posted 2 years ago #

    I am gettin a cononical tag in the header
    Any idea how to remove the canonical tag in header?

    Thanks
    Joachim

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

  2. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    Only if you can code, if you return false on the wpseo_canonical filter it'll remove the canonical. But to be honest; you might as well disable the plugin if you don't want its benefits.

  3. Hans-Joachim Brosch
    Member
    Posted 2 years ago #

    could you please describe it more detailed where to pu the code inside?

  4. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    only if you tell me why you want to disable canonical :)

  5. Hans-Joachim Brosch
    Member
    Posted 2 years ago #

    The canonocal tag revers to the main page. this link revers again to the main page which is not very useful. canonicals make sense if you want to rever on two ore more sub-pages with similar content and you want to bundle the strenghth of this pages.

  6. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    You obviously don't really understand what it does.

  7. sangiro
    Member
    Posted 1 year ago #

    He may not understand but he pointed out a valid issue and your response was't that helpful. We have a site with a plugin that dynamically displays more than 42,000 images on unique pages, each page with its own SEO friendly permalink / URL.

    Your plugin ads exactly the same canonical url to the top of each of those pages. I certainly don't want them all to be seen as copies of the same page, because they are not.

    Love your plugins, especially this one. Hope the solution isn't to just "disable the plugin because I don't want the benefits"

  8. sangiro
    Member
    Posted 1 year ago #

    Just to elaborate on that here are some examples: Your plugin added the flowing code, exactly the same code to all our pages. This code:

    <!-- This site is optimized with the Yoast WordPress SEO plugin v1.2.5 - http://yoast.com/wordpress/seo/ -->
    <link rel="canonical" href="http://www.guitarchords247.com/chords/" />
    <meta property='og:locale' content='en_us'/>
    <meta property='og:title' content='Chords - Guitar Chords 247'/>
    <meta property='og:url' content='http://www.guitarchords247.com/chords/'/>
    <meta property='og:site_name' content='Guitar Chords 247'/>
    <meta property='og:type' content='article'/>
    <!-- / Yoast WordPress SEO plugin. -->

    You could find that on this page:
    http://www.guitarchords247.com/chords/Gsharp-Asharp/

    And on this one...
    http://www.guitarchords247.com/chords/Asharp-B/

    And on this one...
    http://www.guitarchords247.com/chords/Fsharp13/

    And I could could go on to every page. So the way I see it, adding exactly the same canonical tag to the top of each of these pages will tell Google, that they're all basically a copy of one page, this one:

    http://www.guitarchords247.com/chords/

    Let me know if there's something I don't understand.

    PS - It may be that by the time you read this we've removed the plugin just to prevent this from happening so I apologize if you cannot see this on the site right now. I just have no way of telling how long it will be before you respond and cannot leave this code up till then. :)

  9. steven-sanders
    Member
    Posted 1 year ago #

    To remove it, simply add the following code to the end of your theme's functions.php file, just before the closing php tag.

    // Remove Canonical Link Added By Yoast WordPress SEO Plugin
    function at_remove_dup_canonical_link() {
    	return false;
    }
    add_filter( 'wpseo_canonical', 'at_remove_dup_canonical_link' );
  10. toxinhead
    Member
    Posted 1 year ago #

    Joost, stop doing this. Stop putting energy into criticizing and then leaving, he has a valid point. I have been looking around for support and have experienced this multiple times, not good man.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic