Hello,
Thank you for contacting the support, and sorry for any inconvenience that might have been caused due to that.
To change the canonical URLs to point towards the actual page of the language, please modify and use the following filter in your theme’s functions.php file:
/**
* Allow changing of the canonical URL.
*
* @param string $canonical The canonical URL.
*/
add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
return $canonical;
});
Here is an article that will come in handy to know where to use the filters on your website:
https://rankmath.com/kb/filters-hooks-api-developer/
Here is an article that might come in handy, to know more about optimizing your website using weglot with Rank Math:
https://rankmath.com/kb/wordpress-multilingual-seo-with-rankmath-weglot/
Please let us know how that goes. Looking forward to helping you further.
Thank 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.