Viewing 1 replies (of 1 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @joeysander,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    Unfortunately, Polylang is not compatible with our plugin, and that’s why the wrong canonical is added to the translated pages.

    We have a request opened with them for quite a few years:
    https://github.com/polylang/polylang/pull/373

    To fix this, you may need to add the following filter to your site:
    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 that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Document does not contain a valid rel=cannoncial element’ is closed to new replies.