I found out why this happens. if I set the global flag do not index on wordpress canonical links is not displayed, if I remove this flag, it is displayed.. this is not very convenient because I would like to debug this on a demo site that is closed from indexing.
Hello,
Thank you for getting in touch.
I am afraid canonical URLs are only added to pages set to index.
The aim of the canonical URL is to tell search engines which of the indexed URLs is the original page to avoid duplicate content issues. If a page is not set to index then this is not required.
Google actually doesn’t recommend having case where you have used a noindex robots meta along with a canonical URL and that the reason this is set this way be default.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
maybe for debugging, you will provide a global checkbox to force the display of canonical links?
Hello,
Thank you for the follow-up.
Unfortunately, Rank Math is unable to add canonical URLs to your pages/posts if they are set to noindex. You may need to disable the Discourage search engines from indexing this site in your WordPress Settings > Reading while debugging and enable after doing so.
Sorry to disappoint but that feature is unfortunately not available at this time.
With that being said, there are existing feature requests, so I’ve added your vote to our internal suggestions lists. If your suggestions are something that we’re able to introduce, I’ll be sure to let you know.
I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further assistance.
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.