Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Tirane (GMT+02:00)

This topic contains 5 replies, has 2 voices.

Last updated by Marsel Nikolli 8 months ago.

Assisted by: Marsel Nikolli.

Author Posts
May 14, 2024 at 10:01 am #15624646

Raul Pina

Hi!
How can I change the url country code?
It appears /pt-pt and I want /pt.

How can I archive that?

May 14, 2024 at 12:25 pm #15625290

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will gladly help you.

The language code "pt-pt" that you have set is the default for the Portuguese-Portugal language.

To change its code to "pt", you'll need to add a custom language and set its code to "pt", please check the documentation here on how to add the custom language:
https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/#adding-your-own-languages-using-wpmls-gui

Let me know if you have any questions or need further help.

Kind regards,
Marsel

May 14, 2024 at 8:43 pm #15627068

Raul Pina

Hello. Thanks for the response.

I know that pt-pt is the portuguese language, but it doesnt look very nice or user friendly to use the URL domain.com/pt-pt.

I'll check the documentation you sent

May 14, 2024 at 8:46 pm #15627071

Raul Pina

If I change the language code in the database it works?

May 15, 2024 at 7:52 am #15628097

Marsel Nikolli

Hi,

You will need to create a custom language, and you shouldn't change this code inside the DB for existing languages, as it would destroy the connection between the original contents and their translations.

Let me know if you have further questions,
Marsel

May 15, 2024 at 8:08 am #15628164

Marsel Nikolli

If you'd want to proceed with the suggested solution and add the custom language, 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.

* Note: Please make sure you have a full backup of your website before making any updates/changes to your website.

Kind regards,
Marsel

The topic ‘[Closed] change the URL country code’ is closed to new replies.