Only include the homepage for translation
-
I’m trying to ONLY include the homepage for translation, every single other page should NOT be translated.
Previously, entering the entire URL of the homepage in the “Do not translate certain paths” – “Translate Only Certain Paths” option (yes, the wording for this option is not good) under advanced settings > exclude strings, was working but recently, maybe within the last month, this stopped working and now the Spanish translated homepage is being redirected to the default language homepage unexpectedly.
Deactivated all plugins except to TranslatePress and using a default WP theme. When inspecting the 301 redirect, I can see:
X-Qm-Redirects-Redirect-Trace: trp_exclude_include_redirect_to_default_language(), do_action('template_redirect')
This tells me that this is the action that is triggered. I traced it to /plugins/translatepress-multilingual/includes/advanced-settings/do-not-translate-certain-paths.php. That page has the function trp_exclude_include_redirect_to_default_language() and in that function it does some checks to see if the current page matches any of the include / exclude options and the strings provided then handles the redirect. trp_return_exclude_include_url($paths, $current_slug, $array_slugs) is returning NULL instead of TRUE for the homepage which I believe is an error. If I use any other path in that option, it works fine but not for the homepage. The homepage URL is not working, “/” is not working, {{home}} is not working.
What do I need to put in that textarea for “Translate Only Certain Paths” to make it only translate the website homepage?
- The topic ‘Only include the homepage for translation’ is closed to new replies.