• This plugin creates is own canonical tags. Canonical output is now built into WordPress. Here is the code you need to get the url from the meta box set properly.

    Add this code to the canonicalPlugin.php file in the plugin directory.

    add_filter( 'get_canonical_url', 'seo_plugin_bens_override', 99, 2 );
    function seo_plugin_bens_override( $can_url, $post ) { 
        $can = get_post_meta($post->ID, '_Seo_plugin_meta_canonical_tag', true);
        if ( $can ) { 
            $can_url = $can;
        }   
        return $can_url;
    }

    Then remove this line:

    add_action( 'wp_head', 'Seo_plugin_canonical_tag' );

  • The topic ‘Fix for duplicate canonical tags’ is closed to new replies.