How to Replace WordPress Default Search with Relevance-Based Results: A Practical Guide
WordPress ships with a search feature that sorts results by date. Not by how well they match what the visitor typed. I’ve watched visitors on my own sites search for a topic, scroll past the first page of results, and give up because the most relevant post was buried beneath newer but unrelated entries.
When I built Contextual Related Posts, I used MySQL’s FULLTEXT indexing to find posts that were genuinely related to each other based on content similarity. The algorithm worked well, and I wanted to apply the same approach to site search. That’s where Better Search came from.
Better Search replaces WordPress’s default search with a FULLTEXT-based engine that scores and ranks results by relevance. It integrates with your existing theme, tracks what visitors search for, and gives you control over how results are weighted. This tutorial walks through installation, the setup wizard, relevance weighting, custom post types, and the popular searches heatmap.
This guide covers v4.4, the latest version at the time of this post.

Prerequisites
Better Search 4.4.0 requires WordPress 6.6 or later and PHP 7.4 or later. It’s tested up to WordPress 7.1. You’ll also need a self-hosted install with MySQL or MariaDB, since the relevance engine depends on MySQL FULLTEXT indexes. There’s a high chance you have this if you’re hosting WordPress on most hosts. If your host doesn’t let you use a FULLTEXT index, then find a new host.
Installing Better Search
- In your WordPress admin, go to Plugins > Add New.
- Search for “Better Search” in the search box.
- Find the plugin by WebberZone (it’s usually the first result), click Install Now, then click Activate.
On activation, the plugin adds three FULLTEXT indexes to your posts table: wz_title_content on the title and content columns together, wz_title on the title alone, and wz_content on the content alone. These power relevance scoring. On multisite, they’re added to each blog.
Better Search then replaces the default WordPress search straight away. Seamless integration is on by default, which means the plugin uses your theme’s native search template while sorting results by relevance behind the scenes. Nothing in your theme needs to change.
The setup wizard
Once activated, Better Search offers a setup wizard that walks you through the essentials. It’s the quickest path to a sensible configuration, and it covers four steps in the free version:
- Choose Your Features: turn optional components on or off.
- Basic Search Settings: core search behavior
- Content Tuning: which content is included and how results are weighted
- Pro Settings: an overview of what the Pro version adds
You can skip the wizard and configure everything manually. Every setting it touches is available under Better Search > Settings.
The settings screen now has seven tabs: Features, General, Performance, Search, Redirects, Output, and Heatmap. Version 4.4 added a search box to the settings screen itself, so if you know the name of a setting but not which tab it lives on, type it into the box at the top.
How the relevance algorithm works
Better Search builds a relevance score with a MySQL MATCH … AGAINST query against the FULLTEXT indexes. Title and content are matched separately, each multiplied by its own weight, and the two are added together:
The post with the highest score is treated as 100% relevant. Every other result gets a percentage relative to that top score. If the top post scores 50 and another scores 25, that second post shows as 50% relevant.
That percentage is only displayed when seamless integration is off, and you’re using the plugin’s own search template. With seamless integration on, results are still ordered by relevance, but the percentage isn’t rendered.
This is the same approach I use in Contextual Related Posts. Both plugins index the same columns and share the same index names, so if you run both, they use one set of indexes rather than duplicating them.
Configuring relevance weighting
Go to Better Search > Settings and open the Search tab. Under weighting, you’ll find two fields in the free version:
Post title defaults to 10. Post content defaults to 1. In other words, out of the box, a title match counts for ten times as much as a content match. That’s deliberate: on most sites, a visitor searching for a phrase that appears in a post title almost certainly wants that post.
If your titles are short or stylized and the substance lives in the body text, lower the title weight or raise the content weight. If your titles are descriptive and closely match search intent, the default ratio is already doing the right thing.
There’s no single correct ratio. I’d suggest leaving the defaults alone at first, watching what visitors actually search for from Better Search > Popular Searches, and adjusting from there.
Better Search Pro adds weighting for the post excerpt, categories, tags, and a default weight for other taxonomies, along with post slug search.
Including custom post types
By default, Better Search searches posts and pages. If your site uses custom post types such as products, portfolio items, or documentation articles, you’ll want to add them.
On the Search tab, find Post types to include. You’ll see every registered public post type on your site. Select the ones you want in the results and save.
Relevance scoring works identically across post types, since the FULLTEXT indexes sit on the posts table columns rather than on anything post-type-specific.
To let visitors narrow results by post type on the front end, use the search form shortcode with the post type dropdown enabled:
Setting up the popular searches heatmap
Better Search tracks search queries and can display the most popular terms as a heatmap, with more frequently searched terms rendered in larger text and a different color.
Using the widget
Go to Appearance > Widgets and add the Popular Searches [Better Search] widget to a sidebar or footer area. There’s also a Search Form [Better Search] widget if you want the plugin’s search form with its post type dropdown.
The heatmap settings live on the Heatmap tab under Better Search > Settings. You can set the number of terms to display, the font size for the least and most popular terms, the color at each end of the scale, text to insert before and after each term, and whether to include the heatmap on the search results page itself.
Currently trending should contain searches for how many days? Controls the window for the trending heatmap. It defaults to 7 days.
Using the shortcode
To place the heatmap inside a post or page:
The shortcode reads your saved settings by default, and any attribute you pass overrides them. For example, to show the top 10 trending searches with custom colors:
Other useful attributes: format="list" renders an unordered list instead of the default inline layout, orderby="name" sorts alphabetically rather than by count, show_count="1" appends the search count to each term, and daily_range sets the trending window for that instance.
The Features tab
Version 4.4.0 introduced a Feature Manager. The Features tab lets you switch off components you don’t use, so the plugin doesn’t load code you’ll never call.
In the free version, widgets, shortcodes, and block patterns are all enabled by default. Live search, which shows results as you type, is off by default and needs enabling here if you want it.
Where to go from here
Better Search is free on WordPress.orgOpens in a new window. Install it, run the wizard, and your search results improve immediately.
If you need fuzzy matching, “Did you mean” suggestions for zero-result searches, search redirects, boolean mode, relevance thresholds, multisite search, WP-CLI commands, or the Efficient Content Storage and Indexing system for larger sites, Better Search Pro covers it all.
Keep on publishing! Let your users keep on searching.

