Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:We added a custom Chinese language but hreflang is wrong

Solution:1. Go to WPML->Languages -> Add a new language and add the default Chinese language again
2. Click on "Edit languages"
3. Change the hreflang from the default language to something else and update
4. Now you should be able to assign the correct one to the new custom CN language

Relevant Documentation:

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.

This topic contains 3 replies, has 3 voices.

Last updated by vanessaL-2 4 years, 9 months ago.

Assisted by: Bobby.

Author Posts
February 21, 2020 at 2:08 am #5536939

nicholasA-5

We added a custom Chinese language so that we can use /cn in the url. The included Chinese languages in wpml uses different slug and we want it /cn so as a solution, we added a chinese language and set to CN. Now the problem is that hreflang now is showing a wrong value. I can not edit the hreflang in the edit language as it shows hreflang already exists.

Please help.

Thanks

February 21, 2020 at 8:20 pm #5543717

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi There,

1. Go to WPML->Languages -> Add a new language and add the default Chinese language again
2. Click on "Edit languages"
3. Change the hreflang from the default language to something else and update
4. Now you should be able to assign the correct one to the new custom CN language

Let me know your results, please.

April 22, 2021 at 3:04 pm #8602411

vanessaL-2

Hi,
I noticed that now i'm able to update "cn" in the language hreflang, But my when I click on ky flag icon in Chinese, the home page still in domain.com/?lang=zh-hans , when I click domain.com/cn it shows page error 404. Can you advice please?