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.
Best regards,
Prosenjit
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.