Skip Navigation

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

Problem:
We defined the language and were almost done, but we noticed that we made a mistake with the code of the language. We need to change it so that the permalink goes from this ../pt-br/ to .../pt/.

Please advise how can we correct this.

Solution:
To change the slug of the Portuguese language, we'll need to apply a workaround, which is to create a custom language with the code 'pt'. To do it, please follow these steps:

- Go to WPML -> Languages -> Site languages - > Edit Languages
- Click on the button "Add New Language"
- Add a custom language and make sure that the 'code' is set to 'pt' since this is what shows in the URL. Also, use a different default locale from pt_PT as this is already taken (you can use just pt. Screenshot: https://cdn.wpml.org/wp-content/uploads/2018/02/1516916-Screen_Shot_2018_02_13_at_3.23.21_PM_1.png)

Once the language is added, if you have already created your Portuguese content (pages/posts./etc.), you will need to go to WPML -> Translation Management to duplicate them from the original PT language to your new PT language:

- In the WPML -> Translation Management dashboard, make sure to switch the language to Portuguese, and select content that you want to duplicate
- In "2. Select translation options" duplicate them into the new PT language

After this, you can remove the old PT language in WPML -> Languages -> Site Languages -> Add / Remove languages.

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

Last updated by julianoI 2 years, 7 months ago.

Assisted by: Mateus Getulio.

Author Posts
February 11, 2022 at 4:10 pm #10562419

julianoI

Hello,

We defined the language and were almost done, but we noticed that we made a mistake with the code of the language. We need to change it so that the permalink goes from this ../pt-br/ to .../pt/.

Please advise how can we correct this.

Thank you in advance for your time and help on the matter.

February 11, 2022 at 9:07 pm #10563799

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thanks for your contact, and welcome to the WPML support forum!

To change the slug of the Portuguese language, we'll need to apply a workaround, which is to create a custom language with the code 'pt'. To do it, please follow these steps:

- Go to WPML -> Languages -> Site languages - > Edit Languages
- Click on the button "Add New Language"
- Add a custom language and make sure that the 'code' is set to 'pt' since this is what shows in the URL. Also, use a different default locale from pt_PT as this is already taken (you can use just pt. Screenshot: hidden link)

Once the language is added, if you have already created your Portuguese content (pages/posts./etc.), you will need to go to WPML -> Translation Management to duplicate them from the original PT language to your new PT language:

- In the WPML -> Translation Management dashboard, make sure to switch the language to Portuguese, and select content that you want to duplicate
- In "2. Select translation options" duplicate them into the new PT language

After this, you can remove the old PT language in WPML -> Languages -> Site Languages -> Add / Remove languages.

Please try out this workaround and let us know how it goes. We're looking forward to your reply!

Regards,
Mateus.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.