Every site should provide visitors with an easy way to search for content, and good site search ensures users can find what they’re looking for with ease. All WordPress sites include a built-in search function, but for content-heavy websites, this default search can be slow and imprecise.
As a counter, the Jetpack plugin offers its own search functionality. This is based on the Elasticsearch engine and expands the default site search with a more powerful, faster, and customizable search experience.
In this article, we’ll discuss why having a solid search function on your site is important. We’ll also show you how Jetpack’s Elasticsearch-based system can improve your site’s search, before showing you how to use it on your site. Let’s get to it!
What Site Search Is (And Why It’s Important)
As we said, it’s important that your site’s visitors can find the content they’re looking for. As such, every site should provide the ability to search its archives and make this process as easy as possible.
However, it’s not just your users that benefit from being able to search your site. In fact, by implementing this kind of feature, you help ensure visitors remain on your site for longer. It also helps keep your older content relevant, as visitors will inevitably come across it while conducting a search.
A simple site search feature will be immensely helpful, but it’s even better to use an optimized alternative. This is especially true for e-commerce sites, where searching is an integral part of the user experience. You’ll need to make sure users not only find the most relevant results, but that they can tailor their queries to make the process easier and more specific.
How Searching Works on Your WordPress Website
As with so many things, WordPress makes adding a site search easy. Every installation of WordPress contains a built-in site search in the form of a widget. It’s usually added directly to most themes as well.
However, being a default, ‘no-frills’ feature, it’s not always been optimal. It was actually quite poorly thought-of until 2013, when it was updated to include other content beyond posts, and added a prioritization feature.
Even with these updates, WordPress’ search is quite limited in how it serves results, and how you can customize queries. It can be slow at times, especially for sites with of hundreds of pages and posts.
For smaller sites, the standard search widget may well be enough. However, for a more precise site search that’s reliable and configurable, it’s best to look for external alternatives. Let’s take a look at one of those right now.
An Introduction to Elasticsearch
Elasticsearch is a search and analytics engine. While explaining the ins and outs of the engine would lead us into pretty technical territory, we can say Elasticsearch is a customizable and highly compatible alternative to WordPress’ standard search.
There are several ways Elasticsearch improves on the default WordPress search. Here are just a few:
- Real-time indexing. As soon as your site changes, the search index will update automatically. This ensures results are always up-to-date.
- Filtered searches. Searches can be filtered based on different criteria, such as by categories, tags, authors, or custom taxonomies.
- Sort results by date or relevancy. This makes it much easier to comb through search results for the right content.
- Favors recent results. The search will favor more recent content, which ensures more up-to-date posts appear earlier.
- Developer API. Developers can use the Elasticsearch API to further customize the search engine.
- Supports millions of documents. Regardless of how huge your site is, Elasticsearch will be fast and reliable.
The advanced search functionality offered by Elasticsearch can be added to a WordPress site via the Jetpack plugin. It’s included as an additional option in the Jetpack Professional plan, which is itself pre-installed when you get WPWebHost’s WP Plus and WP Geek plans.
Jetpack offers a number of helpful features, and the Elasticsearch-based search is one of the most powerful. It’s also incredibly easy to add to your site. Let’s take a look at how to do it.
How to Implement Jetpack’s Elasticsearch on Your Site
In order to implement Jetpack’s advanced search functionality, you will naturally need the Jetpack plugin installed on your site. You will also need to purchase the Jetpack Professional plan, unless you use one of our hosting plans that include it by default.
When you have installed and activated the plugin, it’s time to implement the new search function. You’ll find this by navigating to Jetpack > Settings > Traffic within WordPress. You’ll see the following settings page:
On this page, you’ll find an option called Replace WordPress built-in search with an improved search experience. This will be toggled off by default:
To activate the advanced search, toggle this option on. Next, you can add the advanced search to your site with a widget. For now, let’s use it to replace your site’s default WordPress search. Navigate to Appearance > Widgets to begin:
Scroll down to find the Search (Jetpack) widget. You can now drag this into the area where you want the search to appear. In this case, we’ve placed it in the sidebar, and removed the default Search widget:
When you add the widget, a number of customization options will appear. Here you can choose the options you want the search to support:
Here you can choose the default sort results and add filters to the search. This enables you to create highly specialized searches, such as only looking at specific categories or post types.
When you’re done customizing the widget, click Save. You can now take a look at your site to see the results:
It might not look much different cosmetically, but you’ll know the search itself will pack a lot of punch under its humble exterior. With that done, you’ve successfully improved your WordPress site’s search functionality!
Making sure users can find what they’re looking for on your site is important. If your site search is imprecise or slow, it could impact your bottom line, especially if you’re running an e-commerce business. You should therefore consider upgrading WordPress’ default search to a more powerful engine.
One great alternative is the Elasticsearch-based functionality offered by Jetpack. This expands your site search to include real-time indexing, customizable queries, and a much faster, dynamic search experience.
Do you have any questions about improving your site search? Let us know in the comments section below!