Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Prosenjit Barman 1 year, 8 months ago.

Assisted by: Prosenjit Barman.

Author Posts
September 2, 2023 at 8:25 am #14329795

janisS-4

Hi!

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?

Thanks!

September 4, 2023 at 9:33 am #14334969

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

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