Support » Plugin: The SEO Framework » Canonical URL deactivate for cpt

  • if i´m not wrong, we can have Canonical URL deactivated in 3 situations

    Link Relationship Settings:
    Add rel link tags to posts and pages?
    Add rel link tags to archives?
    Add rel link tags to the homepage?

    my site have custom post types and I would like to deactivate to all of them. There is any reason why CPT’s have not an option? or Am I loosing something?


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


    Hi Antonio!

    The option for “posts and pages” is for all singular posts, including those of CPT. The same goes for “archives”, where it also takes into account archives for custom post types.

    So, when you deactivate the options, all those link relationship tags will disappear.

    Now, if you wish to disable the canonical URL (and not the link relationships), then you’d have to implement a code snippet. I’m not sure if this is your goal, could you reclarify that? Thank you!

    We have a multisite where the site A and the Site B are almost the same (adults version and kids version), created from a duplication of the content, so the url of the pages is the same (just the site name is different)

    So, in order to not to have duplicate content, and to gain SEO power thanks to the combination of both sites, we require to have from each page a cannonical url from the Site B to the site A.

    We do try to do it automattic in order to be able to apply to any simmilar situation (we have several sites with dozens of pages), so to use your cannonical url in page SEO settings metabox is not an option (since it will be too slow and will require maintainment if we change pages urls).

    But by deactivating that option in the selected site, we will let us to have rel=canonical from our page in the site B to the same page in the site A. Otherwise, we will have rel=canonical twice, from your plugin and from ours

    Plugin Author Sybre Waaijer


    Hi Antonio,

    I understand!

    The snippet below should do the trick. It’ll disable the canonical URL tag from TSF. You can add it to your (child-)theme or a custom plugin.

    add_filter( 'the_seo_framework_rel_canonical_output', '__return_empty_string' );

    You may also want to disable the og:url output. Facebook treats that as the canonical URL. I’m not sure if it’d be helpful in your use-case. Nevertheless, you can do that with this snippet:

    add_filter( 'the_seo_framework_ogurl_output', '__return_empty_string' );

    I hope this helps 🙂 Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.