Plugin for WordPress


How to leverage the Algolia synonyms feature.

Algolia Search plugin for WordPress is no longer supported. Please use our API client guide instead.
Please note that if you already have the plugin set up and are satisfied with your current integration, you can keep using the plugin forever, knowing that it won’t be supported. It will still work as is, in its current state, on your website.
If you want to know more, click here.


The plugin supports the synonym feature of Algolia.

Be sure to understand how synonyms work by reading the synonyms official documentation.

Push Your Own Synonyms

Pushing your own synonyms is fairly simple by using the different filters the plugin provides.

Filter Name Parameters
algolia_posts_index_synonyms array $synonyms, string $post_type
algolia_posts_{$post_type}_index_synonyms array $synonyms
algolia_searchable_posts_index_synonyms array $synonyms
algolia_terms_index_synonyms array $synonyms, string $taxonomy
algolia_terms_{$taxonomy}_index_synonyms array $synonyms
algolia_users_index_synonyms array $synonyms


Plugin Name: Algolia Greeting Synonyms Example

function custom_posts_page_index_synonyms( array $synonyms ) {
    $synonyms[] = array(
        'objectID' => 'greeting',
        'type'     => 'synonym',
        'synonyms' => array( 'hello', 'hi', 'hey' )

    $synonyms[] = array(
        'objectID' => 'tablet',
        'type'     => 'oneWaySynonym',
        'input'    => 'tablet',
        'synonyms' => array( 'ipad', 'galaxy note' )

    $synonyms[] = array(
        'objectID'         => 'street',
        'type'             => 'placeholder',
        'placeholder'   => '<Street>',
        'replacements'     => array( 'street', 'st' )

    return $synonyms;

add_filter( 'algolia_posts_page_index_synonyms', 'custom_posts_page_index_synonyms' );

To fully understand the synonyms arguments please check out the official documentation about synonyms.

As for index settings, synonyms will be reset by the WordPress plugin each time you re-index your content. You should NOT configure your synonyms via the Algolia Dashboard. Instead create a plugin as explained in the documentation page about extending this plugin.