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.

This topic contains 1 reply, has 2 voices.

Last updated by Itamar 1 month, 3 weeks ago.

Assigned support staff: Itamar.

Author Posts
June 17, 2020 at 12:24 pm #6393905



I do not want the /zh-hans as a suffix of the translated Chinese pages of my website which is English by default.

So I added a custom language via WPML ->Languages->Edit languages and add a new custom language for Chinese. Added the desired language code of "cn" and made sure to use a different default locale from the original language.

The problem is that when I enable the "Browser language redirect" option, the Chinese browser do not redirect to the /cn directory because this output is generated:

/* <![CDATA[ */
var wpml_browser_redirect_params = {
/* ]]> */

I would like to add the following to this "languageUrls" list:


Is this possible? Please help!

June 18, 2020 at 4:54 pm #6406179


Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)


The 'Browser language redirect' feature of WPML works according to the language that is set on the browser of the user that is accessing the site. Your custom language code (cn) is not a language code that browsers recognize. Please see this link as a reference.
hidden link
Therefore, I'm afraid that it can not work.

In any case, even if there is a JS solution for this, I'm sorry but this would be our of the scope of our support forum.

At the following link, you can submit a feature request that goes directly to our developers.
They will consider whether it is possible or needed to add this feature.

Otherwise, I can also suggest you consider contacting one of our certified partners from this link:
Before doing so please have a look also here:
With our contractors, you might get the custom assistance you need to get on with your project.

Best Regards,

The topic ‘[Closed] How to add custom language to wpml_browser_redirect_params’ is closed to new replies.