• On the thread below someone gave me a great solution to exclude the canonical link that automatically appears through Yoast’s SEO plugin:

    http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-suggestion-remove-canonical-per-post-or-page

    I was able to make it work for one page using this code on the plugins functions file:

    of function wpseo_canonical_exclude( $canonical ) {
    global $post;
    if ( $post->ID == xxx) {
    $canonical = false;
    }
    return $canonical;
    }
    add_filter( ‘wpseo_canonical’, ‘wpseo_canonical_exclude’ );

    My problem is that I need to exclude the canonical on one more page, but I don’t know the correct syntax. Everything I’ve tried so far breaks it.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Yoast SEO plugin question – exclude canonical on two pages?’ is closed to new replies.