SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

searchwp\stopwords

Since: 4.0.0

Table of Contents

SearchWP uses Stopwords to both optimize the index and increase relevancy of search results.

The primary method of customizing the list of Stopwords is by way of the Settings tab of the SearchWP Settings screen. You can however programmatically filter Stopwords as well.

Parameters

Type Parameter Default Since
String[] $stopwords Localized list of stopwords for your locale 4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Remove all Stopwords

<?php
// Remove all SearchWP Stopwords.
add_filter( 'searchwp\stopwords', '__return_empty_array' );

How to use this code