Home›Support›English Support›[Resolved] Issue with Translating Post Permalink Slugs for Dutch and English
[Resolved] Issue with Translating Post Permalink Slugs for Dutch and English
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to set different permalink structures for posts in Dutch and English using WPML. Specifically, Dutch posts should use the permalink structure: /nieuwsitems/%postname%/, and English posts should use: /newsitems/%postname%/. Despite enabling 'Translate custom post and taxonomy base slugs' in WPML > Settings, setting the post type 'Posts' to Translatable - only show translated items, and configuring slug translations in WPML > String Translation, all posts, regardless of language, use /nieuwsitems/%postname%/ instead of the expected language-specific slugs.
Solution: We have found that WPML does not support translating custom permalink structures. It only supports translating custom slug translation when the custom type is registered. For more details, you can refer to our guide for developers here: Translating Slugs for Custom Post Type Archives.
As a workaround, consider using a Custom Post Type (CPT) instead of standard posts, as this allows for slug translation. Alternatively, you can create a category with the desired slug, assign it to all relevant posts, and update the permalink structure to include the category. This category slug can then be translated. For more guidance, check out these links:
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket at WPML 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.
Background of the issue:
I am trying to set different permalink structures for posts in Dutch and English using WPML on my site hidden link. Specifically, Dutch posts should use the permalink structure: /nieuwsitems/%postname%/, and English posts should use: /newsitems/%postname%/. I have enabled 'Translate custom post and taxonomy base slugs' in WPML > Settings, set the post type 'Posts' to Translatable - only show translated items, and configured slug translations in WPML > String Translation. I flushed permalinks in Settings > Permalinks and tried custom code in functions.php to force slug translation, but it did not work. My environment includes WordPress Version 6.7.1, WPML Version 4.6.14, and several plugins including Elementor and Yoast SEO.
Symptoms:
All posts, regardless of language, use /nieuwsitems/%postname%/ instead of the expected language-specific slugs.
Questions:
How can I ensure that the slug translations are applied correctly for posts in Dutch and English?
Are there any specific WPML settings or configurations that need adjustment?
Kor is unavailable today, but I'll continue to help you with this issue.
I've read this ticket, and I can see the problem here.
hidden link
However, I'm missing information about this case.
Can you please explain what you have configured differently so the slug is right here hidden link, but wrong here hidden link?
I know you already shared access to your site directly in the chat. However, I'm not allowed to use it the way it was shared. If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply. Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ **IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--
WPML supports only custom slug translation (when the custom type is registered) but not custom permalink structure.
As a workaround, you could consider using a Custom Post Type (CPT) instead of standard posts, as this would allow you to translate the slug. If that’s not an option, you can achieve a similar URL structure by creating a category with the desired slug, assigning it to all relevant posts, and updating the permalink structure to include the category. This category slug can then be translated. Here are the relevant guides.