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.

Our next available supporter will start replying to tickets in about 1.68 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Riffaz 4 months, 1 week ago.

Assigned support staff: Riffaz.

Author Posts
June 12, 2019 at 2:23 am #3999201

jamesK-20

Hi there,

Essentially I would like to change the URL of my Korean translated pages from /ko to /kr

I do not want to change the language code as I understand keeping ISO 639-1 language codes is important for browser language detection.

However is it not possible to indicate my language with the language code but have the URLas something custom, in this case using the country code instead?

To date I have reviewed some of the pertinent documentation on your website but without much look. The closest content on the topic is here:

https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/

Unless I am mistaken, the answer is not within this documentation.

I have found an old post from 2017 talking about the exact problem we are facing:

https://wpml.org/forums/topic/bad-language-slug-in-languages-ko-should-be-kr-nb-no-etc/

However the answer is a hack, which is unverified so I wanted to see whether there is a more official solution first. Also I am unsure whether browser language detection would still work with this solution.

Please let me know how to proceed.

Cheers.

June 12, 2019 at 3:06 am #3999431

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

The best way is to create the custom languague and give the language code as you want.
In that case, please follow : https://wpml.org/forums/topic/adding-a-custom-english-language/#post-2790234
This is well explained there.

If you already have a lot of content you can follow: https://wpml.org/forums/topic/bad-language-slug-in-languages-ko-should-be-kr-nb-no-etc/#post-1205312

Also I am unsure whether browser language detection would still work with this solution.
- redirection based on browser language will work fine.
- anyhow, I suggest you to read this as well: https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/how-browser-language-redirect-affects-google-indexing/

Let me know how it goes.

Regards,
Riffaz.

The topic ‘[Closed] Changing to a custom URL but keeping the default country code’ is closed to new replies.