Bolster your WordPress Search with Relevanssi

I was recently working on a site for a client (yes, I build websites too) and one aspect of the website included the ability to use the site’s search function to search for a competitor’s product code and have the site display the equivalent product offered by my client.

In order to implement this function, I decided to insert the competitor’s codes as custom fields to each product’s post. However, therein lay a problem; WordPress’ search function doesn’t search custom fields in posts.

In fact, this is just one of a whole host of restrictions in the WordPress search function. Here’s a few more:

Restrict specific pages, posts or categories from appearing in results.

Track search queries for better understanding of user behaviour.

Cache search results for improved performance.

In fact, I’m surprised that a revamp of the WordPress search has not been included recent development cycles. Maybe it will be included for WordPress 3.4…?

At any rate, despite WordPress’ shortcomings, there is an excellent plugin that will help solve most of your gripes with the standard WordPress search function.

Relevanssi‘s motto is “WordPress Search Done Right” and they mean it too. There’s more features than you can shake a stick at, which makes this comprehensive plugin the perfect candidate for anyone who wants or needs a little more than WordPress’ bare bones search gives you.

The out-of-the-box setup is pretty decent, touting features like using the AND operator as stand (must match all search terms), but falling back to the OR operator (match any term) if there are no results using the AND operator.

Among the other features are the ability to restrict searches to certain categories or tags (or exclude certain ones instead), custom excerpts in your search results (length of snippet set by you), highlighting the search term in search results and even the entire post, once it’s opened from the search results and a user-defined set of stopwords (words to ignore when searched for).

Whatever reason you’re looking for a little more from the WordPress search function, chances are that Relevanssi has the answer you’re looking for. They also have a premium edition, which includes even more specialised options. Check out the feature comparison here.

Have you ever felt hampered by the standard WordPress search? Do you agree that it’s about time for an upgrade? What feature would you like to see included?

12 thoughts on “Bolster your WordPress Search with Relevanssi”

I use relevanssi for the search engine on my blog. It is definitely a head and shoulder above the default wordpress search engine. I would recommend upgrading from the default wordpress search to this if you can.

I tried Relevanssi once. I deleted it soon after installing it. I can’t even remember which of my websites I used it on, but it just didn’t meet my expectations. But, I’m still not completely happy with WP search.

Do you recall what it was that you weren’t happy with? There’s other search plugins that can improve the WordPress search if you’re not happy with it; Relevanssi is just the one I chose because it had the best results for me on that client’s site that I was building.

I wasn’t sure about Relevanssi’s before especially after hearing comments about its usefulness. I tried it and in time I was able to appreciate its features. I am always open to improvements in my wordpress. I am glad I made the decision of applying Relevanssi.

Thanks for this post, I may well try this. You are exactly right about how lame WordPress search is. I do try to limit my use of plugins to a very few. The biggest reason for this is performance – plugins often are resource hogs. But there is also the issue of security (just adding more plugins increases the odds of one you include having some security problem).

Terrific plugin. As usual, Dave, your site is the real deal.
Installed and configured, but can’t get my photos to come up with the results list. They do show up when the article title is clicked. Yes, checked “Index and search your posts’ attachments” (which include photos). Tried setting with custom excerpts/snippets on and off. Cleared cache. No dice. Any advice?

Do you mean to say that you want the featured thumbnail to show up in the search results? If so, it sounds like you need to edit search.php to include the post thumbnails in the results. Indexing the images and attachments will not include them in the search results (it will just pull their alt and title tags into the search index to be matched).

This may be included within relevanssi but I’ve hooked into bing’s API to enhance the search results page on my blog with Google style ‘did you mean’ on my no results page to correct spelling mistakes. That page is a great place to restyle and suggest related or popular content.

Wish your site was as fast as this?

Do It With WordPress is proudly hosted by WP Engine, the very best WordPress hosting that money can buy.

Aside from being blazing fast, it's very secure, has a staging area to test changes before making them live, automated daily backups, malware scanning, stellar support from WordPress experts... It's just everything that you would want from your host, and more.