If you are using FacetWP together with SearchWP or Relevanssi (with the Relevanssi add-on installed), and your search results page (the page with /?s=searchterm in the URL) does not have facets, the search will not work properly: most often it will show no results, or other unexpected query interference may happen, like a different order of results than expected.

This is caused by FacetWP’s SearchWP/Relevanssi integration having to intercept the search query before it can know if facets are being used on the page.

To fix this issue, you have to disable FacetWP for the search results page only, by adding the following code to your (child) theme’s functions.php:

How to use custom PHP code?

PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) { if ( $query->is_search() && $query->is_main_query() ) { $is_main_query = false; } return $is_main_query; }, 5, 2 );

If you are seeing no results on search- or other pages/templates with facets, see this FAQ that lists all common causes.

See also

Last updated: January 30, 2026