Skip to content Skip to sidebar

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

Problem:
The client wanted to maintain the default language page slug/permalink (e.g., mydomain.com/welcome) while setting the language via a URL parameter (e.g., mydomain.com/welcome?lang=de for the German version), instead of using the page ID (e.g., mydomain.com/?page_id=1&lang=de). They also wanted to avoid manually translating menu items that link to an anchor on a specific page.
Solution:
We advised the client to activate the "Translate" option in WPML → Settings → Translated documents options to include the slug in the translation and prevent it from being created automatically from the title. This allows the client to copy the slug from the original page. For translating custom links in the menu, we provided a documentation link:
https://wpml.org/documentation/getting-started-guide/translating-menus/#translating-custom-links-after-wp-menus-sync.

Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, we recommend opening a new support ticket. We also 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 need further assistance, please contact us in the 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.

This topic contains 1 reply, has 2 voices.

Last updated by Andrey 1 year, 4 months ago.

Assisted by: Andrey.

Author Posts
March 12, 2024 at 9:14 pm #15401626

thomasS-214

Hi,

Is there a possibility to keep the default language page slug/permalink (e.g. mydomain.com/welcome) while setting the language via url parameter (e.g. mydomain.com/welcome?lang=de for the german version)?

Currently, all translated pages are referenced by page id (e.g. mydomain.com/?page_id=1&lang=de), oddly even though I changed the setting to use translated slugs for the url rather than the automatic creation.

I am asking this question as I have some menu items which link to an anchor on a specific page. These items are relative links using the slug-based permalink to the page (relative to the domain, e.g. /welcome#heading1). Given the prevalence of this throughout my site, I would like to avoid having to translate every menu items manually.

Thank you for your support.

March 12, 2024 at 10:20 pm #15401693

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

By default, the page slug is generated automatically from the title. If you want to keep the same page slug, you need to activate the "Translate" option in WPML → Settings → Translated documents options. This option will include the slug in the translation and prevent it from being created automatically from the title. You can then copy the slug from the original page.

If you want to translate your custom links in the menu, please refer to this link: https://wpml.org/documentation/getting-started-guide/translating-menus/#translating-custom-links-after-wp-menus-sync.