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

Documentation

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

Available since: 3.0

searchwp_like_min_length

View Parameters »

In order to prevent partial matches on terms that are too short, SearchWP has a minimum word length when finding partial matches using LIKE logic. You can adjust that minimum length using this hook:

<?php
// Change SearchWP's partial match (LIKE logic) minimum word length.
add_filter( 'searchwp_like_min_length', function( $length ) {
return 4;
} );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$length Integer

Minimum partial match word length

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