WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
remove rel="canonical" URL for pages of specified template (3 posts)

  1. jrstaatsiii
    Member
    Posted 2 years ago #

    Hey Joost,

    Thanks for this kick ass plugin! I have a very obscure request, and I will try to explain my rationality.

    I have a need to remove the rel="canonical" for pages that use a specific template. I was able to achieve this in my genesis child theme, by adding this to a template called listings.php:


    /*
    Template Name: listings
    */
    remove_action( 'wp_head', 'genesis_canonical' );
    genesis();

    however I would really like to use your plugin. Is it possible to hook into your plugin to do the same.

    My reasoning:

    I am integrating a 3rd party real estate service from Dakno Marketing--they are great and would refer them to anyone interested in indexable IDX with rational property URLS and title tags. The service resides in a subdomain of your site (I know I wanted a subfolder instead, but didn't have the option!).

    The way that Dakno mimics the style of your site is by having you create a page that you will not link to -- something obscure just for the sake of a small [short_code] that they provide you with. It's not exclusive for WordPress, but looks exactly like a WP shortcode. Anyway, the problem is that the service creates a wrapper of your code and then inserts the search page, listings page, and single property page into the content area. Unfortunately the rel="canonical" is left the same for every page it creates. And what's worse is that its pointing to the dummy page we're trying to keep out of the index. So 1000s of pages are telling google that this dummy page is the source, pretty much negating any hard work we've done using their service.

    Like I said, I was able to fix the problem by removing the action on the genesis child theme, and wanted to know if i could just as easily do so with your plugin installed.

    Thanks again for all the hard work. You have my thanks via donation coming right after i hit post!

  2. gerobe
    Member
    Posted 2 years ago #

    I don't think, that this is a obscure request. I nearly asked the same:

    https://wordpress.org/support/topic/exclude-page-from-wordpress-seo

    I'm no plugin-programming-crack but having the code to remove the canonical entry on a page-template base would be great.

    The best solution would of course be an option in the SEO-setting of a post and page to remove the canonical entry for that specific post or page.

  3. jrstaatsiii
    Member
    Posted 2 years ago #

    Glad to see someone else has this request, hopefully we can get it in a future release. I unfortunately need to move forward, and I think Joost might be on vacation or something, as I havent seen him online for a few days.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic