Available since: 1.0
searchwp_minimum_word_length
Note: Use of this hook will require a manual reindex
By default, SearchWP only indexes (and includes searches for) words that are at least three characters long. You can modify that with this filter.
Example: To index and search for words with at least two characters, add the following to your active theme’s functions.php
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_minimum_word_length() { | |
// index and search for words with at least two characters | |
return 2; | |
} | |
add_filter( 'searchwp_minimum_word_length', 'my_searchwp_minimum_word_length' ); |