Skip Navigation

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

Problem:
You are developing a site and wish to change the language code for Swedish from 'sv' to 'se' to align with Sweden’s official country code and your URL structure preferences. However, WPML does not allow editing the language code once it has been set.
Solution:
We recommend creating a custom language. You can do this by navigating to WPML > Languages > Site languages and clicking "Edit languages". For a detailed guide, visit Editing WPML's Languages Table.
After creating the custom language, set the source language for each post or page directly in the WordPress Editor, inside the right sidebar. You can then connect those posts or pages with existing versions in other languages. For more information on linking translated pages, visit How to Link Already Translated Pages.

Please note that this solution might be irrelevant if it’s outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If this does not resolve your issue, please open a new support ticket at WPML Support Forum.

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 0 voices.

Last updated by Andreas W. 2 weeks, 1 day ago.

Assisted by: Andreas W..

Author Posts
January 16, 2025 at 10:49 am #16601352

Dennis Castillo

Background of the issue:
I am developing a site and want to change the language code for Swedish from 'sv' to 'se' to align with Sweden’s official country code and our URL structure preferences (e.g., neuthox.com/se instead of neuthox.com/sv). I understand that WPML does not allow editing the language code once it has been set. I am referencing a support forum discussion that outlines a method of creating a custom language and transferring translations: https://wpml.org/forums/topic/changing-the-language-code-en-in-the-urls-by-the-code-gb/

Symptoms:
WPML does not allow editing the language code once it has been set.

Questions:
How can I change the language code for Swedish from 'sv' to 'se' in WPML?
Can you assist me in applying the method of creating a custom language and transferring translations as outlined in the forum discussion?

January 16, 2025 at 11:29 pm #16604151

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

You can not change the language code as this would break all the connections of your contents between languages.

You can create a custom language in this case, buy going to WPML > Languages > Site languages and clicking "Edit languages".

Guide:
https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/

Once you create a custom language, you can set the source language for each post or page directly on the WordPress Editor, inside the right sidebar and you further can connect those posts or pages with existing versions in other languages.

Guide:
https://wpml.org/faq/how-to-link-already-translated-pages/

Best regards
Andreas