SearchWP

This Documentation is for SearchWP Version 3

Available since: 1.6

searchwp_weight_threshold

By default SearchWP will consider any result that has a weight greater than zero (as defined by the keyword weights you have defined in the SearchWP settings). If you would like to increase the aggressiveness of┬áthe search algorithm by increasing the minimum weight accepted as a result you can add something like the following to your theme’s functions.php:

<?php
function my_searchwp_weight_threshold() {
// only accept results with a weight of 10 or more
return 10;
}
add_filter( 'searchwp_weight_threshold', 'my_searchwp_weight_threshold' );
view raw gistfile1.php hosted with ❤ by GitHub
[wpforms id="3080"]