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.
If you’re using a static page for your homepage, you can modify the canonical URL in Rank Math’s advanced tab:
https://rankmath.com/kb/advanced-tab/
However, if your homepage is non-static, then you may need to use this filter to update the canonical URL:
https://rankmath.com/kb/filters-hooks-api-developer/#change-canonical-url
Hope that helps.
Thank you.
Hi Reinelle,
Thank you for you try, but it seems your solution doesn’t work.
I have static page. And as you know, it doesn’t allowed to change url for main page. So, even if you change canonical url in advanced tab, it still will not be changed, because of snippet editing.
Please, find attached print screens explaining I wrote.
Have a nice day.
Hello,
Can you please let us know which multilingual plugin you are using for your website?
Looking forward to helping you with this one.
Hi Jeremy,
It’s Polylang.
Hello,
Unfortunately, Polylang is not yet fully compatible with Rank Math. Please add the following filter to set a self-referencing canonical URL:
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
$canonical = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
return $canonical;
});
Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope this helps. Let us know if you need any other 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.