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:

functions.php
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.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/admin/list-tables/class-wc-admin-list-table-products.php:974
  2. CartFlows icon CartFlows200,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) classes/class-cartflows-product-search.php:358
  3. Shield Security icon 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
  4. ATUM WooCommerce Inventory Management and Stock Tracking icon ATUM WooCommerce Inventory Management and Stock Tracking10,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) classes/Components/AtumListTables/AtumListTable.php:4290
  5. FV Flowplayer Video Player icon FV Flowplayer Video Player10,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) models/db.php:2317
  6. Classified Listing icon Classified Listing8,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) app/Models/DataStores/DataStoreWP.php:501
  7. Masteriyo LMS icon Masteriyo LMS6,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/Repository/AbstractRepository.php:524
  8. Better Search icon Better Search5,000+ installs apply_filters( 'wp_search_stopwords', array_values( array_unique( $stopwords ) ) ) includes/class-better-search-core-query.php:2286
  9. Front End PM icon Front End PM4,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/class-fep-message-query.php:403
  10. SrbTransLatin icon SrbTransLatin2,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) lib/Frontend/Search_Query_Transliterator.php:336
  11. FV Player 8 icon FV Player 81,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) models/db.php:2735
  12. annasta Filters for WooCommerce icon annasta Filters for WooCommerce1,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) code/class-a-w-f-frontend.php:2001
  13. MAS Videos icon MAS Videos1,000+ installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/data-stores/class-masvideos-data-store-wp.php:513
  14. easyReservations icon easyReservations700+ installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/data-stores/class-er-data-store-wp.php:551
  15. MarketEngine icon MarketEngine10+ installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/class-me-message-query.php:482
  16. Multisite Shared Blocks icon Multisite Shared BlocksFewer than 10 installs apply_filters( 'wp_search_stopwords', $stopwords ) includes/Query.php:351
  17. NextXen Pre-Order Manager for WooCommerce icon 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.