The categories terms are displayed during a live search when the “Show categories” option is enabled:
It’s possible to exclude certain categories from a live search. The solution requires custom PHP snippets. To make this work:
- Open the
functions.php
file in your child theme and add the code at the end - Or install the Code Snippets plugin and apply this code as a snippet.
To implement the code correctly, you have to know the IDs of the categories you want to exclude. You can read the category ID from the URL when you are on the category edit page.
Custom code
add_filter('dgwt/wcas/search/product_cat/args', function ($args){ $args['exclude'] = array(999, 1000, 1001); // The ID of categories to exclude return $args; });
If you use the Pro plugin version, remember to rebuild the search index after implementing the code.
Go to WooCommerce
→ FiboSearch
→ Indexer (tab) and rebuild the search index
. Wait for this process to finish.