Skip Navigation

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

Problem:
The client has translated their categories but the URLs are not translated as desired. The issue is that the translated category slugs are appending a language code at the end, which the client wants to remove.

Solution:
We explained that WordPress requires each taxonomy term's slug to be globally unique, which means one taxonomy term cannot have a matching slug with another taxonomy term across all taxonomies. To allow for duplicate slugs in different languages, we recommended checking out a post that provides a solution for allowing duplicate taxonomy slugs in WordPress. Here is the link to the post:
https://stackoverflow.com/questions/12806409/allow-duplicate-taxonomy-slugs-wordpress

Please note that the solution provided might be outdated or not applicable to your case. If after checking the known issues and confirming that you have the latest versions of themes and plugins installed, the problem persists, we highly recommend opening a new support ticket. For further assistance, please visit our 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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Osama Mersal 11 months, 4 weeks ago.

Assisted by: Osama Mersal.

Author Posts
February 13, 2024 at 4:23 pm #15298863

nielsO-5

I have translated my categories. Now the thing is that the url is not translated how I want it.

Take the category snapchat

Default url is: hidden link
Translated to English: hidden link
Translated to Deutsch: hidden link

I want it like this:
Translated to English: hidden link
Translated to Deutsch: hidden link

So without the country code at the end.

Can you guys help with this?

February 14, 2024 at 7:41 am #15300323

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) When you use the same slug for all languages, the language code is added to make each slug unique.

Please go to WPML-> Taxonomy Translation, change the translated slug, and save it.

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me much information about how your site is configured.

Best regards,
Osama

February 14, 2024 at 8:55 am #15300569

nielsO-5

Hi, included the debug info:

also. When I change the taxonomy from gdpr-en to gdpr it is then automatically changed back to gdpr-en. So I can't just get it to gdpr which gives me this:

taggrs.io/en/category/gdpr/

Screenshot 2024-02-14 at 09.53.48.png
February 14, 2024 at 9:08 am #15300604

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

It's a WordPress regulation. The $slug has to be unique global to every taxonomy, meaning that one taxonomy term can't have a matching slug with another taxonomy term. Each slug has to be globally unique for every taxonomy.

In order to allow duplication, please check this post. (https://stackoverflow.com/questions/12806409/allow-duplicate-taxonomy-slugs-wordpress)

Best regards,
Osama

February 14, 2024 at 10:27 am #15301265

nielsO-5

Thx i will try!

"You can do this with pages, not posts. Restructure your site by using pages instead."

Do i have category pages or category posts?:

hidden link

February 14, 2024 at 10:33 am #15301311

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I'm not sure if I understand your question correctly, but the URL you shared seems to be a post category archive.

Best regards,
Osama