Skip Navigation

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

Problem:
The client wants to have the same slug for a page across different languages in a WordPress site using WPML, where the language URL format is set to different languages in directories.

Solution:
If you're experiencing this issue, we recommend adjusting the page URL setting to "Translate" to include the slug in the translation. Then, manually copy the slug from the original language to its translation for new pages. For existing translations, you can use the following workaround:

1. Ensure you have a backup of your site.
2. Navigate to "WPML > Languages" and click on "Edit Languages".
3. Set the "Encode URLs" option to YES for all languages (except the original).
4. Select "Copy from original language if translation language uses encoded URLs".
5. Test by sending a new page to translation.
6. For already translated pages, make a minor edit to the original page and resave it, then resave the translation.

This process allows you to have consistent slugs across different language versions of your site. However, please note that this solution might not be relevant if it's outdated or not applicable to your case. If you encounter any issues or if the solution does not work for you, we highly recommend checking related 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.

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 4 replies, has 2 voices.

Last updated by giladT 7 months, 1 week ago.

Assisted by: Prosenjit Barman.

Author Posts
May 5, 2024 at 8:49 pm #15594766

giladT

Hello, in WPML settings on my site I have chosen the following:
Language URL format
Choose how to determine which language visitors see contents in
Different languages in directories ( (hidden link - English, hidden link - Bulgarian) )

And the posts' and pages's slugs are being generated from the title, but I would like them to be the same in all languages.
For example:
hidden link
hidden link

What settings should I adjust to achieve that?

May 6, 2024 at 9:21 am #15596195

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand what you're looking for. To keep the slug of both the default and the translated pages or posts the same as in the default language, you need to follow these steps:

- Please go to 'WPML > Settings' and scroll to the "Page URL"
- Select 'Copy from original language if translation language uses encoded URLs' and save the changes.
- once done, try to translate a new page or post. The translation will have the same slug as default.

Just to let you know, for posts or pages that have already been translated, you'll need to manually update the slug for those. To do this, switch to the other language language from your WordPress dashboard using the language switcher at the topbar of Admin. Then locate the translated page or post, click on "Quick Edit," and then modify the slug as required.

I hope the information above will help. Please feel free to let me know if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

May 7, 2024 at 8:48 am #15600454

giladT

If this, described option, not work?
I thought that this option was supposed to work like that, but unfortunately it doesn’t work and the URLs are always translated.
Can you check this?

May 8, 2024 at 5:07 am #15604185

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

I understand and sorry for not clarifying the use case of the "Copy from original language if translation language uses encoded URLs" option earlier. This setting is specifically designed to work with encoded URLs, meaning it automatically copies content from the original language if the URL for the translation language includes special encoding.

If you're dealing with languages that do not use encoded URLs, you should adjust the page URL setting to "Translate" (this will include the slug in the translation and will not automatically create it from the title). After setting this, proceed to translate a new page and manually copy the slug from the original language to its translation to have the same slug in other languages.

However, there is a workaround that can help you copy the slug from the default language to its translation. WPML offers an option to 'encode URLs' for each language. By enabling this feature, you can encode the URLs of the language so that translations can use the same slug as the default language. This helps to have a consistent slug across different language versions of your site. Here are the steps:

1. Make a backup first
2. Go to "WPML > Languages" then click on "Edit Languages"
3. On that screen you can set the option "Encode URLs" to YES for all languages (except the original)
4. Make sure you've selected "Copy from original language if translation language uses encoded URLs"
5. Send a new page to translation as a test.
6. For already translated pages you need to make a small edit on the original page (like adding a space in the title) and resave it. Then enter the translation and resave the translation.

I hope this information is helpful. Since there isn't a direct feature to copy the slug from the original language, hopefully, you can achieve what you're looking for by following the instructions provided above.

Feel free to let me know if you need further assistance or clarification in this matter. I will be happy to help.

Best regards,
Prosenjit

May 9, 2024 at 8:10 am #15609334

giladT

So it means that if I will enable encoded URLs for all languages and will have to translate already published posts it will generate new URLs for that post's translations?