0

I have been using the "Polylang" plugin to translate my website. The original page has the URL "mysite.de/about-us". The translated page should have the URL "mysite.de/en/about-us". The "/en/" part has already been added by the plugin and is also displayed that way in the WordPress page editor. However, WordPress automatically adds a "-2" to the slug. This makes it difficult for internal links that should point to the correct page using , depending on whether the URL with "/en/" is being accessed or not. Is there a way to prevent WordPress from adding "-2" to the slug?

Regards

2
  • Depending on the plugin, it may be using some permalink trickery to add the "/en" in your URL, which might mean two pages can't have the same slug. I don't know anything about Polylang, but if you want support specific to that plugin you'll have to contact their specific support routes as questions about third-party plugins are off-topic here.
    – YourManDan
    May 31, 2023 at 14:06
  • 1
    As an alternative solution, can I suggest translating the slug into whatever other language you're using? It will be best practice for SEO and usability instead of the workaround you're looking for.
    – YourManDan
    May 31, 2023 at 14:07

2 Answers 2

1
  1. Go on your back-office, and go on Polylang (Languages) Settings.
  2. Then, on URL modifications, check if the option "The language is set from the directory name in pretty permalinks" is checked.
  3. If not, check it.
  4. Then click on Save changes. Now, you should see this option below : "Share slugs Activated"

"Allows to share the same URL slug across languages for posts and terms. The module is automatically deactivated when using plain permalinks or when the language is set from the content in the URL modifications."

Now you should be able to have the same url slug across different languages. It works on my website. With these settings, I can obtain:

example.com/about-us/ (main language)

example.com/en/about-us/ (translated content)


However, I dont recommend you to use the same slug across different languages. It's not a good practice and harm the SEO of your website.

Hope it helps !

0

Also you can use the plugin to bulk update slug - Polylang same slug

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.