SearchWP

This Documentation is for SearchWP Version 3

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

[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]