Canonical url with noindex

#439343
  • Resolved David Antón
    Rank Math free

    Hello there,
    We are using your plugin on a wordpress site and we have a problem with using the canonical URL and the noindex, nofollow together. Basically we have a page that has the noindex,nofollow options but we also need to set the Canonical URL. Although we have the URL set on the options that your plugin gives the tag with the canonical URL does not appear on the page. We assume that your plugin does not add the canoncial url when the noindex,nofollow options are selected but we would need to add it even with those options.

    Thank you very much for your time,

    David from WeDevio.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support and bringing your concern to our attention.

    Yes, our plugin doesn’t add the canonical URL to your page if the robots meta is set to noindex. It serves no purpose to add a canonical URL since the search engine crawlers will not be able to see it.

    However, if you still need to forcibly add the canonical URL, you can do so by using this filter code:

    add_action( 'rank_math/head', function() {
      // Add logic here to apply this to a specific page.
      echo '<link rel="canonical" href="http://yourdomain.com/yourpage" />';
    }, 99 );

    You can add the filter by following this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Looking forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Canonical url with noindex’ is closed to new replies.