Noindex a page and keep the canonical – John Mueller’s advice

#461466
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    By default, Rank Math does not add a canonical URL when a page is set to noindex.

    Once you set the pages to Noindex, the canonical tag will be removed as well since there is no need for it as Google isn’t going to index those pages.

    Here’s a link for more information(section 5.3):
    https://rankmath.com/blog/canonical-urls/#common_canonicalization_issues

    Hope that helps.

    Thank you.

    Hey, I would still like to have a noindex page with a canonical set. Here’s why: https://www.searchenginejournal.com/when-to-use-rel-canonical-or-noindex-or-both/427522/

    Nigel
    Rank Math business

    Hello,

    Rank Math does not allow adding canonical tags to noindexed pages. You would have to do it with custom code. The code snippet below is a starting point, you would need to set the code to dynamically get canonical URL for the current page and check if the page is set to noindex:

    
    add_action( 'rank_math/head', function() {
    	echo '<link rel="canonical" href="https://example.com/canonical-from-code/" />';
    });
    

    Hope that helps. Please let us know if you have questions.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Noindex a page and keep the canonical – John Mueller’s advice’ is closed to new replies.