Yoast SEO
[Plugin: WordPress SEO by Yoast] Duplicate canonical tags in header (6 posts)

  1. adsdevshop
    Posted 5 years ago #

    I'm getting duplicate canonical tags on my pages and posts, one is inside of the WordPress SEO commented section, and the other is elsewhere in the header. I am running the latest version of WordPress 3.1.3 and the Genesis framework.

    After doing some testing and adding the following filters to my functions.php:

    remove_action('wp_head', 'genesis_canonical');
    remove_action('wp_head', 'rel_canonical');

    ... what I get is this:

    With the plugin active + NO "remove action" - duplicate canonical tags
    With the plugin disabled + NO "remove action" - a single canonical tag
    With the plugin disabled + A "remove action" - no canonical tag

    I have tried using only one of these remove_actions at a time, and then combining them both. Regardless, as long as I have the plugin active I get duplicate canonical tags.

    Is this a bug in the plugin, perhaps somehow enabling the canonical functionality of WordPress?

    Thanks for your help as this is driving me crazy.


    Robert Dempsey


  2. gyutae
    Posted 5 years ago #

    I'm also using the Genesis theme and having the same issue when using the WordPress SEO plugin.. Perhaps it could be something to do with the built-in SEO functions of the Genesis framework theme not completely being disabled?

    Let me know what you come up with.

  3. gamue
    Posted 5 years ago #

    I have some kind of the same problem. I'm using a own template and this has a own logic for defining the canonical-url (in the header.php). With the seo plugin enabled I get a duplicate canonical url in the header and some times different ones which is very bad :(

    Is there a option to disable the canonical part from the seo plugin? I've commented the part out but with the next update it's back again i think.
    Would be nice i it would be possible.

  4. pepo5
    Posted 5 years ago #

    Agree on this point. I think they should add an option to disable canonical links on the plugin.

    Hope Yoast consider this.

  5. carsuk
    Posted 4 years ago #

    In case anyone else is looking for a solution to this, we've found something that works for us:

    function canonical() {
        remove_action( 'wp_head', 'rel_canonical' );
    add_action( 'init', 'canonical', 99 );
  6. rick4him
    Posted 4 years ago #

    I am getting a duplicate canonical and I think a duplicate meat description. My theme already does a lot of the SEO, and I'm mainly using this plug in to allow me to enter in custom meta descriptions and titles.

    Does anyone know if this solution solves the problem?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic