Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 thread is resolved. Here is a description of the problem and solution.

Problem: The language code for Portuguese is pt-pt, and the client wanted to change it to just "pt".

Solution: To change the language code slug:

* Create a new custom language and set the code there.

=> Go to WPML=> Languages , "Site Languages" , and click on Edit Languages, from there add language.

eg. create your custom language as Portuguese but set the slug as pt instead of pt-pt

* OR (not advisable unless it's the only option) make the change in the *_icl_languages table (usually wp_icl_languages)

You can do that by changing the slug directly from the database.

***This may be dangerous! Please make sure to back up the database first. ***

You need to make the change in the *_icl_languages table (usually wp_icl_languages)

Once you have change language code please click on WPML > Support > Troubleshooting. Look for 'Clean up' and click on 'set language information' button.

100% of people find this useful.

Tagged: 

This topic contains 5 replies, has 4 voices.

Last updated by albertoG-50 4 years ago.

Assigned support staff: Bobby.

Author Posts
November 23, 2015 at 10:50 am #752400

Retired Account

Hi! I've been using your plugin for months and I love it, but today when I added the portuguese version of the website I saw that the language code is "pt-pt".

I intend to have only one portuguese version, so the second "pt" won't be necessary. Is there any way to change the slug to only "pt"?

Thank you very much

November 23, 2015 at 5:16 pm #752832

Bobby
Supporter

Languages: English (English )

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

Hello,

Thank you for contacting WPML Support,

To change the language code slug:

* Create a new custom language and set the code there.

=> Go to WPML=> Languages , "Site Languages" , and click on Edit Languages, from there add language.

ex. create your custom language to be Portuguese but set the slug as pt instead of pt-pt

* OR (not advisable unless that's the only option) make the change in the *_icl_languages table (usually wp_icl_languages)

You can do that by changing the slug directly from the database.

***This may be dangerous! Please make sure to back up the database first. ***

You need to make the change in the *_icl_languages table (usually wp_icl_languages)

Once you have change language code please click on WPML > Support > Troubleshooting. Look for 'Clean up' and click on 'set language information' button.

However, please be advised that it is complicated to change it later.

Again, please make sure to backup everything before proceeding.

Let us know if you need more information.

November 24, 2015 at 10:31 am #753374

Retired Account

Oh, that's great: I did that and works. The only issue now is that the footer still links to the /pt-pt/ version, even if I removed it and deleted its categories and posts.

November 24, 2015 at 10:35 am #753380

Retired Account

Ok, it's gone now! Thank you very much

January 12, 2017 at 10:55 pm #1181178

pauloF-2

Hi There,

i have the same problem and i changed the database becaue the complete website was nearly redy translated. but now after changing the slug in the database it doesnt work and there are no traslated pages anymore..what can i do..?

October 10, 2019 at 1:57 pm #4731055

albertoG-50

Hi,
although I know this issue is resolved, I am trying to follow the instructions and I cannot create a custom language from pt instead of pt-pt.

There is an alert saying that the local configuration already exists ¿?¿?

Is there any other way to do this without having to edit the files?

Thank you