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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Radu 3 months, 2 weeks ago.

Assigned support staff: Radu.

Author Posts
June 25, 2019 at 8:39 am #4082333

john-davidE

Hello,

I am wanting to change the Language/Translation Url Slug from /zh-hans to /cn for "China"

I was looking at this documentation:
https://wpml.org/documentation/support/editing-wpmls-languages-table/

When I tried adding a custom language, the page didnt include a slug and it redirected to the home page.

Are you able to give more information into how Risky/What steps are required (Detailed)
For this documentation:
https://wpml.org/documentation/support/editing-wpmls-languages-table/#editing-languages-directly-in-the-database

I saw this was a common response in other related questions, but not much detail was explained or any evidence of people trying it. They were also posts from years ago So I was wondering if there is an easier/updated version to best update the language/translation slugs.

Thank you!

June 25, 2019 at 9:12 am #4082571

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey John,

When you create the new language as explained in the video from here https://wpml.org/documentation/support/editing-wpmls-languages-table/, you have to make sure that the value added to the code field is cn. This is the value used for the URL slug. Can you try this out, create a new page, and tell me if the link is looking as you want, please?

Thanks,
Radu

June 25, 2019 at 7:04 pm #4086927

john-davidE

Hello Radu,

I have tried this out, I think it may be working correctly.
The Slug is now "domain.com/cn/test-page" however if it were a homepage, it would remove "test-page" im assuming.

Because I have all of my content setup on "zh-hans" what is the best way to swap the language without causing issues. First time using the plugin and found it a little confusing to setup. So I will need to change my Pages and My Menu translations to "cn" (My custom language) instead of zh-hans? And it shouldn't break any of my content?

Thanks for your help so far!

Cheers

June 27, 2019 at 7:00 am #4097089

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey John,

Now that you added the new language to your website, you can easily duplicate the content from the old Chinese (/zh-hans/) language to the new one (/cn/) by using the option to batch duplicate content. Please have a look here https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/using-content-duplication/#batch-duplicating, give the presented steps a try, and tell me how this works.

Thanks,
Radu

The topic ‘[Closed] Changing Language/Translation Slug URL’ is closed to new replies.