Integrations / Platforms / WordPress / Quick Start

While Algolia doesn’t offer an official WordPress integration, you can make your own. This guide walks you to the process of building your own Algolia WordPress integration using the PHP API client.

Adding Algolia to your WordPress website takes three main steps:

  1. Indexing your data
  2. Optimizing relevance
  3. Building the front-end search experience

There are two ways to index your data, either by creating a custom plugin or adding the feature to your active theme. The recommended way is to create a plugin to hold all the generic code, so you can reuse it for another blog or when switching themes.

In WordPress, most features live in the theme (such as custom post types or post meta), making it challenging to keep things truly separated. The best solution is to create a plugin to take care of the plumbing work and keep the content-related logic in the theme.

Requirements

This guide assumes some basic WordPress development knowledge. Typically, you know what a custom post type and a post meta are, and how to use actions and filters. You also need some elementary PHP skills and knowing how to run commands from your terminal.

Regarding technical requirements, make sure you have:

  • PHP 5.3 or newer (version 7.1+ is highly recommended)
  • An up and running WordPress instance
  • WP-CLI

Did you find this page helpful?