WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Duplicate canonical tags in header (6 posts)

  1. adsdevshop
    Member
    Posted 3 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.

    Sincerely,

    Robert Dempsey

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

  2. gyutae
    Member
    Posted 3 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
    Member
    Posted 3 years ago #

    Hey,
    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
    Member
    Posted 2 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
    Member
    Posted 2 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
    Member
    Posted 2 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

About this Topic