Skip to content

[09], plugin 10: Subset Search

Put the best match first in your site's search results

Ranked search results from a fast index, with a search log.

WordPress search finds posts that contain every word and lists the newest first. Subset Search indexes your content and ranks the results, so the post that best matches what your visitor typed comes first.

To install and update the free plugins from wp-admin, add the Subset Installer.

DocumentationChangelog

Requires
PHP 8.1+
Tested to
WP 7.1
WP-CLI
Yes
Multisite
Yes
Editions
Free + Pro

How Subset Search works

Saving a post adds its words to an index in the plugin's own tables, with English stemming, so a search for "booking" also finds "bookings" and "booked". A full rebuild runs in small steps from Subset → Search → Index, WP-Cron or wp subset search index, so it doesn't time out on shared hosting.

A search is scored in the database with BM25, the ranking formula most search engines start from. Every word is required by default. When that finds nothing, results that match some of the words are shown, best first. You can change the weight of each field and post type without reindexing.

The plugin answers the search WordPress already runs and hands the ranked posts back to WordPress's own query. Your theme's results template, the search block and the excerpts it shows keep working, and a page that isn't a search runs no extra database queries.

Under Subset → Search → Tester, type a search and see how it was read, which pass answered it and each result's score broken down by field.

What each version includes

Pro is a separate add-on that installs alongside the free plugin. Everything in the free list stays free.

Free

Full plugin

No time limit and no upgrade nags.

  1. Relevance ranking with BM25 and field weights
  2. Partial words, phrases, synonyms and stemming
  3. Highlighted excerpts and did-you-mean suggestions
  4. Search log with the searches that found nothing
  5. A Tester that explains each result's score
  6. WooCommerce, Polylang and WPML support
  7. Import from Relevanssi
  8. Multisite, WP-CLI, a REST API and a search form block

Pro

Add-on

Everything in Free, plus:

  1. Pinned and excluded results for a search
  2. Searches that go straight to a page
  3. Text from PDF, Word and OpenDocument files, read on your server
  4. Results as visitors type, from the search form block
  5. Authors and terms as results
  6. ACF fields, page builder content and WooCommerce variations
  7. Recency and boost rules
  8. Stemming and stopwords in 13 more languages
  9. Search across the sites of a network
  10. A year of search counts, with clicks by result position
  11. Ranking by meaning, with your own OpenRouter key
  12. Import from SearchWP

Questions

Do I need to change my theme?
No. Subset Search answers the same search WordPress runs, so your search form, results template and the search block all work as before.
How fast is it?
On a generated site of 10,000 long posts, a three-word search scores in about 13 ms, and the whole search, including WordPress's own query for the results page, takes about 18 ms. A full rebuild indexes about 14,000 posts a minute. Your numbers depend on your host and your content.
How many posts can it handle?
It's built for sites up to about 200,000 posts. Past that, a hosted search engine such as ElasticPress or Algolia is a better fit, and Site Health will say so.
Does the search log store personal data?
No. It stores the search text, the number of results, the time and where the search came from. A search that looks like an email address or a card number is stored as a hash. Entries older than 30 days are deleted daily.
Does it work with WooCommerce and multilingual sites?
Yes. With WooCommerce, product SKUs and attributes are searchable, and products set to Shop only or Hidden stay out of search results. With Polylang or WPML, each post is indexed with its language, and a search finds the posts in the visitor's language.
I have Relevanssi or SearchWP active. What happens?
Subset Search stands aside while another search plugin is active, and Site Health tells you which one. Import your settings from Relevanssi under Subset → Search → Index (Pro also imports from SearchWP), deactivate the other plugin, and Subset Search takes over.
What happens when I delete the plugin?
The index, settings and search log are deleted, on every site of a network. The index is rebuilt from your posts if you install the plugin again. To keep the data, add define( 'SUBSET_SEARCH_DELETE_DATA_ON_UNINSTALL', false ); to wp-config.php before you delete the plugin.

Underneath

Every Subset plugin has WP-CLI commands and documented hooks and filters.

Read the developer reference

Hear about Subset Search releases

We’ll email you when Subset Search has a new release, and only about Subset Search.

One confirmation email, then nothing until we have news. Unsubscribing takes one click and no account.

We will email you a confirmation link. Click it and you are on the list. Until then nothing is confirmed.