Web Analytics

Making WordPress Search Usable: How to Do It

by Jason Unger, Founder

For as much as we love WordPress (and you know we do), we’re not afraid to say where its issues are.

One piece of functionality that has never been truly developed in WordPress is search.

And for the most part, that’s OK, since it’s not a core competency of the software. But, nearly every site we build includes a search feature, so it’s something that we’ve spent a fair amount of time improving.

Out of the box, when you do a search, WordPress will look at titles and content for your posts and pages. If you’re just using WordPress as a blog, that may be an OK approach — but for most sites, it isn’t. With so much content being stored in custom fields, or users wanting to find comments or custom taxonomies, you need to be able to find more.

Luckily, there are a few ways to do that – and make WordPress search usable.

Relevanssi, Search Everything and Other Plugins

Obviously, one of the great things about WordPress is that the community steps up to improve functionality where it is lacking. So there’s plenty of plugins that improve the built-in search engine.

Our favorite is Relevanssi, which replaces the built-in WordPress search engine with its own. There are a ton of advanced options, like …

  • Search results sorted in the order of relevance, not by date.
  • Fuzzy matching: match partial words, if complete words don’t match.
  • Find documents matching either just one search term (OR query) or require all words to appear (AND query).
  • Search for phrases with quotes, for example “search phrase”.
  • Create custom excerpts that show where the hit was made, with the search terms highlighted.
  • Highlight search terms in the documents when user clicks through search results.
  • Search comments, tags, categories and custom fields.

Relvenassi also has a Premium version, which offers you support, additional features like results weighting, and Multisite support.

Search Everything is another popular option because it does exactly what the title says it will. Since so many of the sites we build store data in custom fields, or in custom post types and taxonomies, the built-in search won’t look there; Search Everything makes it.

While these two plugins tend to be the ones we work with, there are a number of other options out there.

Google Custom Search Engine

If you want to do search right, why not go to the company that built it right?

Google offers their Custom Search Engine as a mini Google search just for your site. It uses the same software as their search engine, so it’s pretty good — and it searches just your site.

There’s two different options: free and paid. With the free version, Google ads are included — but you can actually connect your Adsense account and make some money off of them. If you go with the paid version (starting at $100/year), you can remove all of the ads and better brand the search engine to your site.

We used to do Google Custom Search Engines all the time for our clients, but have scaled back recently as we more often …

Fine Tune the Search Engine Through Coding

At the end of the day, WordPress’s search can be fine-tuned pretty well, especially if you add in filtering and can modify the queries being passed.

For example, on one of our most recent site launches, Businesses for the Bay, we needed to build a way to find members based on a number of factors, including their location, the project themes they’ve worked on, and their membership type.

This meant we needed to:

  • search a custom post type (members)
  • dynamically build select menus based on the different states, project themes and membership types
  • build queries that would show results based on any combination of the possible inputs

Thankfully, using the power of Advanced Custom Fields and plenty of time spent in the WordPress Codex, we were able to build a fully-functioning Member search engine, which exists side-by-side with the normal site search.

WordPress Search: Don’t Settle

Like with so much of WordPress, the core contributors are hesitant to build in functionality that can better be handled by a plugin. It makes a lot of sense, especially since every site is different.

But as your site gets more complicated and more custom, you’ll likely find that you need some advanced search functionality. Thankfully, it can be done — and when it is done, it’s quite powerful.

Avatar photo
About Jason Unger

Jason Unger is the Founder of Digital Ink. He built his first website on Geocities, and hasn't looked back since. Digital Ink tells stories for forward-thinking businesses, mission-driven organizations, and marketing and technology agencies in need of a creative and digital partner.

Other Stories You May Like

What’s your story?

Let’s share it with the world.

Let’s Do This

Close Window
All the Cool Kids are Doing it

Sign Up for the Digital Ink Newsletter

All the cool kids are doing it.