Skip Navigation

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.

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Itamar 6 days, 8 hours ago.

Assisted by: Itamar.

Author Posts
December 13, 2024 at 1:55 pm #16511620

luukC

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?

December 16, 2024 at 3:38 pm #16518139

luukC

Hi There,

Any update available?

December 16, 2024 at 5:32 pm #16518473

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi.

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.--

Thanks,
Itamar.

December 17, 2024 at 5:39 pm #16523050

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Luuk.

Thanks for the access details.

I can see that the post's permalink is configured with a custom structure like this: /nieuwsitems/%postname%/.

I'm consulting our second-tier supporters about this issue and will update you once I receive their reply.

I appreciate your patience.
Itamar.

December 17, 2024 at 8:30 pm #16523465

luukC

Thanks Itamar, we have set this up to make all posts have this url structure. Before it was without /nieuwsitems/ so only /%postname/

December 19, 2024 at 9:10 am #16528818

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter explained the following:

WPML does not support translating custom permalink structures. This is noted in this guide for developers.

https://wpml.org/documentation/support/translating-slugs-for-custom-post-type-archives/

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.

https://wpml.org/documentation/getting-started-guide/translating-page-slugs/

https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/

Regards,
Itamar.

December 20, 2024 at 11:04 am #16533493

luukC

Thanks for your detailed explanation Itamar, we will take care of it.
Kind regards, Luuk

December 22, 2024 at 3:31 pm #16537960

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks, Luuk.

I'm closing this ticket.

Don't hesitate to contact us again with any WPML issues or questions.

Take care,
Itamar.