I have a custom WordPress taxonomy "collections"
I have three languages, each has a translated slug for this taxonomy
LV - kolekcija
RU - kollekcija
ET - kollektsioon
The issue is with alternate hreflangs. When on Russian language, it outputs this:
<link rel="alternate" hreflang="ru" href="hidden link" />
<link rel="alternate" hreflang="et" href="hidden link" />
<link rel="alternate" hreflang="x-default" href="hidden link" />
When on default LV language, it works fine
<link rel="alternate" hreflang="lv" href="hidden link" />
<link rel="alternate" hreflang="ru" href="hidden link" />
<link rel="alternate" hreflang="et" href="hidden link" />
It seems something is off with how it gets term link when on non-default language.
I have reset permalinks.
It's interesting that I have a dev version of this website and there it seems to work fine. Although, it has diverted a little from original version, so I'm not sure what is different there.
Any suggestions what to reset, clear, repair here?
Hello There,
Thanks for contacting WPML Support. Sorry for the delay in responding due to the weekend.
I understand the issue you're having. While checking the WPML Debug log, I noticed that the Translation preference for the "Collection" taxonomy is set to "Translatable use translation if available or fallback to the default language". It means that if a translation doesn't exist, the default content will be displayed in another language.
I guess this is the reason the hreflang link isn't displaying correctly in the translated post. Please follow the steps below and check if that helps.
- Please go to WPML > Settings and scroll down to the "Taxonomies Translation" section.
- Change the translation preference for the "Collection" taxonomy to "Translatable only show translated items" and save the changes
- Now, open the default post under the "Collection" taxonomy and make a small change.
- Save the changes and update the translation as well.
- Save the permalink structure from "Settings > Permalink" [Optional]
Please let me know if the steps above brings the desired outcome or if you need further assistance in this matter. I will be happy to help.