Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 replies, has 1 voice.

Last updated by Paweł Halicki 1 day, 3 hours ago.

Assisted by: Paweł Halicki.

Author Posts
April 28, 2026 at 7:53 am #17998842

ahmedH-37

When doing a search, for example ''enviro-sachet'', the results show 2 products (1 in english, and 1 in french), but they both bring to the same page (same url, correcte language), but on the search results the title of the product is in french.

hidden link

April 28, 2026 at 8:47 am #17999078

ahmedH-37

The root cause came from this snippet : WooCommerce ACF Table Search Engine & Sync

The existing posts_where snippet was extending the search query with an OR EXISTS clause to search inside ACF table metadata. The problem was that OR bypassed WPML's language filter entirely -- any product matching the search term was returned regardless of language, pulling in both the English and French versions of the same product.

Fix
We appended a language filter directly to the WHERE clause that excludes any product ID belonging to a language other than the current one. This filter queries WPML's own translations table (icl_translations) to identify which product IDs are in the wrong language and blocks them from appearing in results.

The fixed snippet now does two things:

Searches ACF table metadata as before
Enforces language filtering so only products in the active site language appear in results

April 28, 2026 at 9:54 am #17999335

Paweł Halicki
Supporter

Hello,

I’m glad to hear that the issue has been resolved, and thank you very much for the detailed explanation.

I would really like to see a fix come out of this case that could be permanently included in our products to improve compatibility and prevent similar issues in the future. If possible, I’d like to identify the source of the WooCommerce ACF Table Search Engine & Sync snippet - whether it’s a custom implementation or comes from a specific source or plugin. This would allow us to potentially detect it and apply a fix automatically.

Kind regards,
Pawel