Background of the issue:
I am using WPML on my site hidden link. I want to keep my URL slugs in English even after translating the page content to Japanese. The URLs currently change to Japanese, and I want them to remain in English with the /ja path included.
Symptoms:
WPML automatically translates my slugs to Japanese when I want them to stay in English.
Questions:
Is there an automatic way to convert my slugs from Japanese back to English?
How can I keep my URL slugs in English while translating page content to Japanese?
The URL slug typically gets translated when the Page URL setting in WPML is configured to "Translate" (Screenshot: hidden link). However, if you're using a language with non-Latin characters and the page URL setting is set to "Auto-Generate", the URL slug will be copied directly from the title of the translated post or page. As a result, the slug will appear translated but it's actually derived from the title of the translated page or post.
If you prefer not to translate the URL slug or want to keep it the same as the default language, you have two options:
1) Set the Page URL to "Translate" and manage the slug in the Translation Editor:
- Go to "WPML > Settings" and under the Translated Documents Option, set the Page URL to "Translate."
- After enabling this option, when translating a page or post, the slug will be available in the editor for translation. You can manually input the slug (e.g., keep it in English if you don't want the slug translated) and save the translation. This way, the slug in the translated language won't be changed.
2) Copy the slug from the default language:
- Set the Page URL option to "Copy from original language." Once configured, the slug from the default language will be copied to the translated version after translation.
- Before selecting this option, you'll need to enable the Encode URL option for the language to which the slug will be copied. Here's how:
- Go to "WPML > Languages" and click Edit Languages.
- In the Encode URL column, set the dropdown to "Yes" for the language using non-Latin characters (e.g., Japanese).
- Save your changes.
Once this is done, set the Page URL option to "Copy," and when you translate a new post/page into Japanese, the slug will remain the same as in the default language.
Please note that changing the Page URL setting will NOT impact posts or pages that have already been translated. For those existing translations, you'll need to manually edit the slug.
To do so, switch to the secondary language using the language switcher in the top bar (Screenshot: hidden link). Then, navigate to Pages/Posts or the relevant post type where the translated post is located. Find the translated post and click "Quick Edit" under its name (Screenshot: hidden link). In the Quick Edit panel, update the slug as needed and save your changes.
You can choose either of the options above based on your specific needs. I hope it will help.
Feel free to let me know if you need further assistance or clarification. I will be happy to help.
Best regards,
Prosenjit
The topic ‘[Closed] WPML automatically translates my slugs to Japanese when I want them to stay in English’ is closed to new replies.