Skip Navigation

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

Problem:
The client is attempting to use "uk" as a custom language code for a variation of English on their website. They have manually changed the Ukrainian language code in the database to "urk" to free up "uk", but this resulted in redirection to the French version of the site.
Solution:
We advise against manually editing the database records for pre-existing languages, as it can lead to unexpected behavior. Instead, we recommend adding Ukrainian as a language in WPML, then navigating to WPML -> Languages -> Edit Languages. Here, you can change the language name to something like "English-UK" and adjust the default language locale and hreflang to match the English (UK) settings. After these changes, the client should be able to access their site using the

site.com/uk/

URL.

If this solution does not seem relevant to your situation, please open a new support ticket with us.

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 2 replies, has 2 voices.

Last updated by Sajjad Saleem 1 year, 3 months ago.

Assisted by: Bobby.

Author Posts
January 4, 2024 at 8:47 pm #15152960

Sajjad Saleem

I am trying to use "uk" as a language code for a custom language. It is another variation of English.

I changed previously held ukrainian language code to urk in database to make space for uk but it is still not working. It redirects to french when I do this.

When I enter this, hidden link. It takes me to hidden link. It is wrong.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
I am using "ca" code here using nginx, but I want to utilize wpml. hidden link

What is the link to your site?
hidden link

January 4, 2024 at 10:22 pm #15153081

Bobby
WPML Supporter since 04/2015

Languages: English (English )

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

Hi there,

Please note that we highly discourage you from editing the database records of the pre existing languages as this can cause unforeseen results and not work as expected.

The pre loaded languages will use standard procedures with the language codes therefore this is based on ISO values and WordPress values.

Now to achieve what you would like to achieve the best way would be to add the Ukrainian language, and go to WPML->languages->Edit languages and from there edit the language name to English-UK for example, as well as changing the default language locale to match the EN UK one along with the hreflang.

Once this is finished you should be able to use the site.com/uk/ URL.

Let me know your results, please.

January 5, 2024 at 5:35 pm #15155979

Sajjad Saleem

I have done a database reset and then used these steps. It is still redirecting it to /fr/.

hidden link is redirecting to hidden link

Screenshot 2024-01-05 at 22-34-11 Languages ‹ BIONIC® Dog Toys — WordPress.png
January 5, 2024 at 5:51 pm #15156090

Sajjad Saleem

I had to create a homepage for this language and it worked.