Last active
April 26, 2019 14:33
-
-
Save jchristopher/152edd90d67aaffe778e to your computer and use it in GitHub Desktop.
Remove specific words from SearchWP's default stopwords list without removing/replacing them all
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_stopwords( $terms ) { | |
// we DO NOT want to ignore 'first' so remove it from the list of common words | |
$words_to_keep = array( 'first' ); | |
$terms = array_diff( $terms, $words_to_keep ); | |
return $terms; | |
} | |
add_filter( 'searchwp_stopwords', 'my_searchwp_stopwords' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment