Home›Support›English Support›[Resolved] WPML allows you create two categories with the same slug across languages
[Resolved] WPML allows you create two categories with the same slug across languages
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.
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?
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.
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.
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).
Yes it's safe as long as you do it on a secondary language (meaning using WPML)
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.