Although Algolia doesn’t have an official WordPress integration, you can build your own with the PHP API client.
Adding Algolia to your WordPress projects takes three main steps:
- Index your data
- Optimize relevance
- Build your search experience
You can index your data in two ways: by creating a custom plugin or by adding the feature to your active theme. Plugins allow you to reuse your code in other projects or when switching themes.
In WordPress, most features, such as custom post types or post metadata, live in the theme. This makes it challenging to separate plugin features and content-related logic. It’s better to create a plugin for the “plumbing” work and to keep the content-related logic in the theme.
This guide assumes some basic WordPress development knowledge. For example, you should know what custom post types and post metadata are and how to use actions and filters. You should know PHP and how to run commands from your terminal.
You need these technical requirements: