Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP's many hooks, get support

Available since: 1.4.1

searchwp_and_logic_only

By default, SearchWP takes an AND pass first when performing searches, followed by an OR pass if the AND pass yields no results. If you would like to force SearchWP to only perform an AND pass and skip the OR pass if no results are found after the AND pass, you can use this filter.

Example: To have SearchWP utilize only AND logic when performing searches, add the following to your active theme’s functions.php:

<?php
add_filter( 'searchwp_and_logic_only', '__return_true' );
view raw gistfile1.php hosted with ❤ by GitHub
Fix Search on Your Site. No Coding Required!

Now you can utilize all of the content that's gone unrecognized by native WordPress search instantly with SearchWP

Get SearchWP