Error with canonical link and og:url on main blog page
-
I have Polylang plugin activated, but I followed your recommendations completely https://rankmath.com/kb/polylang-compatibility/
Problem:
I have pages https://example.com/blog/, https://example.com/ru/ru-blog/, https://example.com/en/en-blog/, on them the code is correct link rel=”alternate”, but link rel=”canonical” and meta property=”og:url” are set incorrectly. On the specified pages, the Canonical URL field was not manually changed.Links in link rel=”canonical” and meta property=”og:url” look like this:
https://example.com/blog/blog/
https://example.com/ru/ru-blog/ru/ru-blog/
https://example.com/en/en-blog/en/en-blog/
If I enter the desired URL in the field Canonical URL of the page, it is not corrected (everything remains unchanged). But if you enter a link to the main page https://example.com/ in this field of the ru and en versions, then link rel=”canonical” and meta property=”og:url” are corrected in their code. At the same time, if I set the page https://example.com/blog/ there is a link to the main page, then in the code the correction occurs, but the header of the template of this topic page breaks
It seems to me that there is a bug or inaccuracy somewhere in your Polylang compatibility code that is causing this
Other settings:
On the page /wp-admin/options-permalink.php is set:
https://example.com/blog/%postname%/Submitted on the page /wp-admin/admin.php?page=rank-math-options-general:
The first switch to remove /category/ from base links is onThere are no other plugins or conditions in functions that can affect these fields
PS. The category pages of the blog do not have this problem
- The topic ‘Error with canonical link and og:url on main blog page’ is closed to new replies.