Support » Plugin: The SEO Framework » How to disable canonical URL generation on specific pages

  • Resolved olivermerk


    Is there a simple way to disable the generation of a canonical URL on specific pages?

    We have a self-programmed product plugin, that is embedded as a shortcode on an extra page and outputs all of our products within this page. TSF thus generates for every product the same canonical URL, so we have problems with Google indexing.

    <link rel="canonical" href="" />

    Is there a simple “magic code” I could enter into the Canonical URL field of this product page to disable the generation on this page? So I could create the canonical URL by myself in the product plugin code?

    Best regards,

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer


    Hi Oliver,

    I recommend filtering the canonical URL in WordPress’ function wp_get_canonical_url():

    You’ll want to filter get_canonical_url. It will then work cross-platform.

    Alternatively, this filter will do the trick:

    add_filter( 'the_seo_framework_rel_canonical_output', '__return_empty_string' );

    I hope this helps! Cheers 🙂

    Thread Starter olivermerk


    Hi Sybre,

    thanks, that hint indeed helped me to set up my own filter for canonical URL.


    • This reply was modified 3 years ago by olivermerk.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to disable canonical URL generation on specific pages’ is closed to new replies.