-
To give context we migrated from yoast to rankmath which yoast was causing issues with the canonical url’s.
Please note: We have yoast deactivated at the moment. This issue does not happen when we also deactivate rankmath
So on our categories pages (blog post categories / post categories) the canonical URL is being injected strange. It gets injected as “domain.com/./category-handle/” so if our category handle is “blog” rankmath injects our canonical url as “domain.com/./blog”
Note: I know you can override the canonical URL on these category pages, which does work. HOWEVER it adds a rel=”next” item as well that has the WRONG canonical URL.
Here is the code snippet that rankmath injects into our header:
*I have changed the domain to domain.local manually in the code segments below
<link rel="canonical" href="https://domain.local/blog"> <link rel="next" href="https://domain.local/./blog/page/2/">
you can see the first link is fine, the second one (that rankmath is injecting) is incorrect.
How can we resolve this?
The ticket ‘Canonical URL weird for Category Pages’ is closed to new replies.