Improving WordPress search with Algolia

Helping customers to find things quickly reduces frustration and can lead to higher sales. The search functionality provided out-of-the-box by WordPress is at best considered basic. With customer expectations set by the likes of Google and Amazon, how can we improve the often overlooked on-site search experience?

How to Improve WordPress Search with Algolia

If like us, you’re looking to improve the user experience of your website, follow along as we discuss how you can improve your WordPress search experience with Algolia. Additionally, we will cover a couple of technical tips and tricks to ensure everything plays together nicely.

A problem searching for a solution

The process to locate relevant information is otherwise known as the search algorithm.

The out-of-the-box algorithm used by WordPress is fairly simplistic. They calculate relevancy by looking for a full sentence match and then for results containing each word individually. The algorithm only looks across two fields; the title and content.

Algoila: search-as-a-service

We’ve worked with a number of search solutions over the years, from WordPress plugins to Solr and Elasticsearch. We’ve recently been integrating with hosted solutions, one such solution being Algolia.

https://www.youtube.com/watch?v=q_9mnYSZu0k

The benefits of using Algolia

The following are a few of the improvements we can expect from switching to an Algolia powered search solution:

WordPress and Algolia

Algolia's find as you type interface in action on Hand Made Places
Algolia in action on Hand Made Places

The integration of Algolia within WordPress is easier thanks to the WordPress Search with Algolia plugin.

Initially developed by Algolia, the plugin is now maintained and developed by WebDevStudios.

The plugin handles the indexing of WordPress data. It replaces the default WordPress search algorithm and can also integrate Algolia’s Instant Search feature.

The plugin has interchangeable settings. This allows you to choose the WordPress data to send to Algolia and supports the usual pages, posts, tags and categories. It also picks up custom post types and taxonomies.

Post meta can store additional information alongside post objects. For example, a product may have a field to store its SKU. In order to search by SKU, Algolia must register and index this field.

Keeping everything in sync

The plugin monitors content changes by hooking into WordPress. Saving a page triggers a reindex of that item. Deleting a page will remove the item from Algolia.

Algolia’s index can occasionally get out of sync which can lead to less relevant or missing results. The interface allows us to manually reindex. However, you can automate this process.

Algolia tiers their pricing based on the number of indexing operations as well as total record count. As such, we want to keep the number of indexing operations in check.

To automate the reindexing, we’re going to make use of the WP-CLI commands provided by the plugin. Using a cron job, we can schedule a periodic reindex.

To avoid burning through indexing operations, we build a sensible cron expression. Our clients typically follow office hours so we run our indexing operations weekdays at 6pm.

Wrapping it up

Search is an often overlooked aspect of an overall website that contributes to a better user experience. As a result, if done well, it will quickly lead customers to the right product, with less typing. Hopefully we have given you a better understanding of what you can do to improve your WordPress search experience with Algolia.

Get in touch

Speak with us today to find out how we can help deliver a delightful search experience for your WordPress website project.

Drop us a line on 01785 279985

Send us an email hello@kanukadigital.com

Quick Enquiry

Your information will be handled in line with our Privacy Policy.