Note: You are viewing the documentation for Version 4View Version 3 Docs

searchwp\query\partial_matches\did_you_mean

Since: 4.0.0

Table of Contents

Control whether SearchWP’s performs “Did you mean?” style corrections to searches that apply partial matching logic.

Parameters

Type Parameter Default Since
Boolean $enabled true 4.0.0
Array $args
Key Type Value
tokens Array Tokens for this search
query \SearchWP\Query The Query taking place
4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Disable "Did you mean?" functionality

Disable “Did you mean?” functionality

<?php
// Disable SearchWP's "Did you mean?" functionality.
add_filter( 'searchwp\query\partial_matches\did_you_mean', function( $enabled, $args ) {
return false;
}, 10, 2 );

How to use this code

Fix keyword search on your site. No coding required!

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

Get SearchWP