This Documentation is for SearchWP Version 3

Available since: 3.1


View Parameters »

SearchWP has the ability to support “Did you mean?” style search suggestions for queries that yielded no results. This feature can be enabled by ticking the checkbox on the Advanced tab of the SearchWP settings screen, or programmatically using this hook:

// Enables "Did you mean?" search corrections in SearchWP.
add_filter( 'searchwp_do_suggestions', function( $enabled, $args ) {
// $args contains the search arguments.
return true;
} );
view raw functions.php hosted with ❤ by GitHub

With this feature enabled, SearchWP will automatically correct misspellings and output a note indicating that a correction has been made.

For additional information please see Automatic “Did you mean” (search query corrections)


Parameter Type Description
$enabled Boolean

Defaults to false

$args Array

The arguments passed to the search algorithm