Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active February 28, 2020 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/6b6caa72949b8c6fac71c279c2b010d0 to your computer and use it in GitHub Desktop.
Save jchristopher/6b6caa72949b8c6fac71c279c2b010d0 to your computer and use it in GitHub Desktop.
Remove all stopword exclusion from SearchWP
<?php
function my_searchwp_stopwords( $terms ) {
// do not exclude any words from the index
return array();
}
add_filter( 'searchwp_stopwords', 'my_searchwp_stopwords' );
@simplemama
Copy link

simplemama commented Mar 18, 2019

According to new PHP warning:
Notice: searchwp_common_words is deprecated since version 3.0! Use searchwp_stopwords instead.

New code:

<?php

function my_searchwp_common_words( $terms ) {
  // do not exclude any words from the index
   return array();
}

add_filter( 'searchwp_stopwords', 'my_searchwp_common_words' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment