WordPress filter hook · part of WordPress core
wp_search_stopwords
A WordPress core filter that 17 plugins also fire themselves, running on 7.3M+ sites between them.
“This filter is documented in wp-includes/class-wp-query.php.”
How to use wp_search_stopwords
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'wp_search_stopwords', function( $stopwords ) {
// Change $stopwords here.
return $stopwords;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
17 plugins that fire wp_search_stopwords
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/admin/list-tables/class-wc-admin-list-table-products.php:974 -
CartFlows200,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )classes/class-cartflows-product-search.php:358 -
Shield Security30,000+ installs
apply_filters( 'wp_search_stopwords', \array_map( fn( $word ) => \strtolower( \trim( (string)$word ) ), \explode( ',', _x( 'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www', 'Comma-separated list of search stopwords in your language' ) ) ) )src/Tables/DataTables/LoadData/ActivityLog/EventSlugSearch.php:64 -
ATUM WooCommerce Inventory Management and Stock Tracking10,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )classes/Components/AtumListTables/AtumListTable.php:4290 -
FV Flowplayer Video Player10,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )models/db.php:2317 -
Classified Listing8,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )app/Models/DataStores/DataStoreWP.php:501 -
Masteriyo LMS6,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/Repository/AbstractRepository.php:524 -
Better Search5,000+ installs
apply_filters( 'wp_search_stopwords', array_values( array_unique( $stopwords ) ) )includes/class-better-search-core-query.php:2286 -
Front End PM4,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/class-fep-message-query.php:403 -
SrbTransLatin2,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )lib/Frontend/Search_Query_Transliterator.php:336 -
FV Player 81,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )models/db.php:2735 -
annasta Filters for WooCommerce1,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )code/class-a-w-f-frontend.php:2001 -
MAS Videos1,000+ installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/data-stores/class-masvideos-data-store-wp.php:513 -
easyReservations700+ installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/data-stores/class-er-data-store-wp.php:551 -
MarketEngine10+ installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/class-me-message-query.php:482 -
Multisite Shared BlocksFewer than 10 installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/Query.php:351 -
NextXen Pre-Order Manager for WooCommerceFewer than 10 installs
apply_filters( 'wp_search_stopwords', $stopwords )includes/admin/class-npom-admin-ajax.php:337
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.