Stop Polylang Redirecting the Homepage by Browser Language
Keeps visitors on the homepage they asked for instead of Polylang redirecting them to another language based on their browser, which also avoids caching and SEO surprises.
Opens WPIDE on
Code
add_filter( 'pll_redirect_home', '__return_false' );
Notes
Visitors can still switch language with your language switcher.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.