WordPress.org

Ready to get started?Download WordPress

Forums

Quark
[resolved] How do i remove the canonical Url? (7 posts)

  1. slamjam
    Member
    Posted 11 months ago #

    How can i remove the canonical url in your theme? I am using Yoast, now i have two canonicals.

    http://www.inserate-börse.ch

  2. ahortin
    Member
    Theme Author

    Posted 11 months ago #

    Adding the following in functions.php should do it.

    remove_action('wp_head', 'rel_canonical');
  3. slamjam
    Member
    Posted 11 months ago #

    Thx. And thank u for this great theme.

  4. ahortin
    Member
    Theme Author

    Posted 11 months ago #

    My pleasure :-)

  5. slamjam
    Member
    Posted 11 months ago #

    Sorry, me again.

    That's not working :-). Any other ideas?

  6. ahortin
    Member
    Theme Author

    Posted 11 months ago #

    You might want to look into what other plugins that you have running. Something else might be adding it in.

    I've just run a few tests. Without Yoast's SEO plugin installed, the above function will remove the default canonical link added by the theme. When Yoast's SEO plugin is activated, it automatically removes the default one and adds it's own (leaving just the one url still). And yes you're right, adding the above wont remove the one added by Yoast SEO. But even so, my test site still only had one canonical url. I would suggest trying to disable some of your other plugins to see if it's being added by something else.

  7. slamjam
    Member
    Posted 11 months ago #

    Thanks for your help. it's a plugin bug/error. I will contact the Plugin author.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.