Home / Forums / WoodMart support forum / Product Search Issue in Woodmart Theme
Home › Forums › WoodMart support forum › Product Search Issue in Woodmart Theme
Product Search Issue in Woodmart Theme
- This topic has 3 replies, 2 voices, and was last updated 3 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
March 26, 2026 at 6:42 am #714159
bonusParticipantWhen using the default product search in the Woodmart theme, I noticed the following behavior:
If I enter a search term consisting of multiple words (e.g., “red leather bag”), the search results only return products that contain all words in the exact order as typed.
If a user skips a word and types, for example, “red bag” (skipping “leather”), the search returns no results, even though relevant products exist.
This limitation reduces the relevance of search results and makes it harder for users to find products.Expected Behavior:
The search should return products containing all entered words, regardless of their order, and ideally support partial matches.March 26, 2026 at 2:10 pm #714224Hello,
Please deactivate all the 3rd party plugins and activate only theme-required plugins on the site and then check the issue. I am sure your issue will be solved. Then Activate the 3rd party plugins one by one and check which plugin is creating the issue for you.
Otherwise, if the issue still exists then keep the 3rd party plugins deactivated and share the WP admin login details of your site so I will check and give you a possible solution.
Best Regards.
March 30, 2026 at 2:07 am #714486
bonusParticipantAfter testing, I confirmed that this behavior is not caused by plugins or custom code, but rather by the default WordPress/WooCommerce search logic, which relies on LIKE queries and matches exact phrases instead of individual words.
To resolve this, I implemented a custom solution:
Added a FULLTEXT index to the wp_posts table (post_title, post_content)
Modified the search query using the posts_search filter to use MATCH … AGAINSTThis allows the search to match individual words regardless of order, and now queries correctly return the search.
My question is:
Is there any plan to support FULLTEXT search or improve word-based matching in future Woodmart updates, especially for AJAX search? It would greatly improve the search experience for WooCommerce stores with larger product catalogs.Thanks in advance!
My code in functions.php:
add_filter(‘posts_search’, ‘use_fulltext_search’, 20, 2);
function use_fulltext_search($search, $wp_query) {
global $wpdb;if (empty($wp_query->query_vars[‘s’])) {
return $search;
}$search_term = esc_sql($wp_query->query_vars[‘s’]);
return ” AND MATCH({$wpdb->posts}.post_title, {$wpdb->posts}.post_content)
AGAINST(‘{$search_term}’ IN NATURAL LANGUAGE MODE)”;
}March 30, 2026 at 11:09 am #714521Hello,
Currently, WoodMart does not provide an option for this. Such modification requires complicated WooCommerce code customization, which is not covered by our support.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register