Skip Navigation

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

Problem:
The client was able to create taxonomy terms with the same slug across different languages. He wanted to make sure that this would not result in duplicate slugs and creates issues with WordPress.
Solution:
We have confirmed that it is possible to have the same slug in different languages with WPML. This functionality was implemented following feature requests from customers. For more information and historical context, you can refer to the following resources:

If this solution does not apply to your situation, or if it seems outdated, we recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please do not hesitate to open a new support ticket with us.

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 Nicolas V. 1 year, 3 months ago.

Assisted by: Nicolas V..

Author Posts
February 22, 2024 at 1:41 pm #15333824

stanimirZ

I have the following problem with a production site but I have reproduced the problem on a clean install of sitepress-multilingual-cms.4.6.9.zip on WP 6.2.3 with the default install theme (in English) and no other plugins installed. The problem concerns taxonomy terms with the same slug - I am able to create two categories/tags with the same slug across languages. So for example I have a category in English with a slug 'the-slug' and a translation of this category in German with the same slug. This happens if I edit the slug (after I have created it) in the default Post>Categories edit category/tag screen. When you first create the translation of the slug WPML correctly appends the language suffix to the slug ('the-term-de'), but if I edit the slug and remove the suffix, it is saved without a problem (and I see in the DB that it is the same)! As far as I know WP doesn't allow the same slugs within a taxonomy (and that is why WPML appends the suffix). So when can we expect a bug fix for this problem?

February 22, 2024 at 3:44 pm #15334564

stanimirZ

The title of this ticket implies that I intend to create categories/tags with the same slug across languages, which is NOT the case. My issue is that WPML allows for the creation of identical slugs across languages, which will mess up a whole lot of things! WordPress is designed with unique slugs within a taxonomy in mind. Read my original post carefully! And the auto-creation and copying of terms on "Overwrite with..." functionality should also be checked and all other cases where terms are created by WPML and such a duplication might occur. My suspicion is that WPML 'hides' from itself the identical slug from the other languages, maybe using wp_query which it filters itself to search only within the current language.

February 22, 2024 at 9:48 pm #15335704

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

The ticket has been created using your first message from the chat. But thanks for the clarification. I'm still waiting for some feedback. I'll get back to you as soon as possible.

February 22, 2024 at 10:06 pm #15335707

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hi again,

I found out that you can actually have the same slug in different languages. That has been a request/discussion years ago as you can see here on those references:
https://wpml.org/forums/topic/category-not-updating-after-wpml-translation/
https://wpml.org/errata/translated-term-slug-identical-to-the-original-term-slug/
https://core.trac.wordpress.org/ticket/43271

SO yes, with WPML you can use the same slug in different languages.

February 25, 2024 at 12:24 pm #15341361

stanimirZ

Are you saying that this is safe with WPML installed and enabled? Because it sure isn't the norm - otherwise WP wouldn't be attaching numeric suffixes to terms with the same name (in the same tax).

February 26, 2024 at 1:06 pm #15344411

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

Yes it's safe as long as you do it on a secondary language (meaning using WPML)