Wrong Hreflang Values
-
Hi,
I use Polylang to manage the different language versions of my site, I currently have three languages:
– Spanish for Mexico (Main language)
– English for Canada
– English (Generic for non-Canadian English-speaking users)These are my Polylang language settings: https://imgur.com/a/MjG4al1
However, when checking the Hreflang tags that are being generated, the Hreflang tags on the homepage look like this: https://imgur.com/a/VoxVpVl
I’ve checked Polylang’s documentation and other user’s own publications in the forum and they all seem to recommend using the “pll_rel_hreflang_attributes” filter.
But on Polylang’s own Filter Reference there’s no example on how to use it and I’ve seen some users saying that when they are able to change the Hreflang attributes accordingly, the original Hreflang tags are still published but they do not say how to delete them.
So my questions are
– How to change the Hreflang tags using the pll_rel_hreflang_attributes filter so I can show the “es-MX” value for Spanish and just “en” for the non-Canadian English/Generic version?
– How to make sure only my newly created Hreflang tags are shown instead of having duplicate Hreflang tags (those automatically created by Polylang and my own custom ones)?The page I need help with: [log in to see the link]
The topic ‘Wrong Hreflang Values’ is closed to new replies.