exclude_local_search doesn't work with additional Polylang languages
Describe the bug
On multilingual sites using Polylang the "Exclude this page from all search queries on this site" only works for posts in the default language. If you search for something in another language besides the default, the results include posts regardless of having search exclude checked or not.
How to reproduce the bug
Steps to reproduce the behavior:
- Have a WP site with at least 2 languages using Polylang
- In a language that is not default, check "Exclude this page from all search queries on this site." for a post
- On the side of the site for that language, use the default WP search to look for something that matches the excluded post
Expected behavior
The search result should not include the post that has been excluded from search.
Actual behavior
The search result does include the post that has been excluded from search.
Additional context
After a report of the bug from a live site, I've reproduced this bug locally on a fresh WP install that had only the following in use:
- Default Twenty Twenty-Five theme
- Polylang + The SEO Framework
Oddly enough the "Exclude this page from all archive queries on this site" works fine, which I would assume is nearly identical.
Hi @lecklin,
Thank you for the bug report!
Could you please verify if changing the option "SEO Settings > Performance > [...] Perform alteration:" from "In the database" to "On the site" affects this issue?
Heyas @sybrew, changing that option has no effect.