Support » Plugin: Polylang » Custom Post Type with Translations Changes Site Language

  • Hello,

    I have a client who runs a site with a lot of works in different languages (books, essays, etc.). These are all their own custom post type and have been enabled in Polylang. Language switching works great on a site level (which is also needed, but not entirely relevant to the problem I’m having).

    Let’s take a book as an example “Title of Book”. This book was written in English, but also has a translation in German. Site default language is English and is default in Polylang. German has been added as a language in Polylang and for the book “Title of Book”, a German version is created with title “Buchtitel”. The permalinks are: and respectively. When a user visits: they get the English version. When a user visits: they get the German version and the site language switches to German. This is unwanted by the client.

    If the user is viewing the English site and the user clicks on a German book they want to view the German book in English. If the user is viewing the site in German and the user clicks on an English book they want to view the English book in German.

    My questions are:

    1. Is there a way within the plugin settings to achieve this? I’ve tried modifying the “Languages > Settings > URL modifications” to “The language is set from content” but this still changes the language of the site when I visit the permalink of the German book.
    2. Is there a way to programmatically achieve this? I’m a dev so feel free to post code and/or technical info.
    3. Would the pro version of Polylang offer a solution to this?

    Thanks in advance!

    • This topic was modified 1 month, 3 weeks ago by praeix.
  • You must be logged in to reply to this topic.