Please make sure to update to WPML 4.3.4 before reporting any issue

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 topic contains 1 reply, has 2 voices.

Last updated by Yuri 2 years ago.

Assigned support staff: Yuri.

Author Posts
November 9, 2017 at 11:43 am #1425776

Neil Hillman


Our site's structure used two letter COUNTRY codes, instead of LANGUAGE codes as it's directories, so for example, Denmark is "DK" for the country code, instead of "DA" for the Danish language.

To do this, we have had to edit a few of the WPML languages, to change the "code" from the default two letter values.

But we want to keep the correct "Default locale" and "Language tag" for Denmark, as this is then used for the <html lang="da"> tag in the HTML.

But when I try to edit the language I get the messages "The default locale already exists." and "The tag already exists.", trying to force me to use new values.

Won't this result in the pages having the wrong HTML lang attribute values in the <html> tag?

How do I fix this?


November 9, 2017 at 12:33 pm #1425896


Hi, WPML will normally not allow you to create another language with the same language tag and default locale codes. This is because there is already a preset language that is using them. To circumvent this configuration without having to edit the database records directly you can execute the following procedure:

- add the default language that has the locale and tag codes that you want to use. For example, I want to add the Portuguese (Brazil) language with "BR" instead of "PT-BR". I will add the default Portuguese (Brazil) language first.
- edit the languages and change the locale and tag for the default language with any other value
- add your custom language and set it up with the locale and tag you want
- remove the default language you added before.

I'm attaching an image showing how I've configured my own installation with a default language and a custom language changing the values around. Take notice that this screenshot is before I delete the default language.

Let me know if you need any further assistance with this issue.