Title: Add Synonyms functions.php
Last modified: January 20, 2023

---

# Add Synonyms functions.php

 *  Resolved [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * (@laurentfrom47)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/)
 * Hi,
 * I try with this code in my functions.php to add synonyms
 *     ```wp-block-code
       function custom_posts_devis_index_synonyms( array $synonyms ) {
         $synonyms[] = array(
             'objectID' => 'installation',
             'type'     => 'synonym',
             'synonyms' => array( 'installation', 'pose' )
         );
         return $synonyms;
       }
       add_filter( 'algolia_posts_devis_index_synonyms', 'custom_posts_devis_index_synonyms' );
       ```
   
 * After that i re-index but this don’t work ?
 * Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16394171)
 * Just to be certain, `devis` is the post type you’re trying to add some synonyms
   for?
 * Also this specific filter looks like it’s for the Autocomplete indexes, so if
   this is meant for instantsearch, you’d want `algolia_searchable_posts_index_synonyms`
   for the filter name, and based on our wiki docs, there’s not post type specific
   version of that filter.
 *  Thread Starter [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * (@laurentfrom47)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16398797)
 * Hi, yes devis is the post type to add synonyms.
 * Yes it is for autocomplete indexes.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400296)
 * Just to be certain, you’ve checked and confirmed the appropriate indexes in your
   algolia.com dashboard correct?
 *  Thread Starter [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * (@laurentfrom47)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400337)
 * Yes, but i found another solution, i add synonyms directly in the algolia dashboard.
 * Thanks.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400369)
 * Hmm
 * I was able to get synonyms added to my configuration with a test post type:
 * [⌊Screen Shot⌉⌊Screen Shot⌉[
 * Just to be certain, you’re using the “Push Settings” from the post type row on
   your Autocomplete page, correct?
 * [⌊Screen Shot⌉⌊Screen Shot⌉[
 * Not the “Search Page” options page?
 *  Thread Starter [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * (@laurentfrom47)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400382)
 * Ah, i think i have not do that!, i need to re test that.
 * Thanks.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400396)
 * With the settings buttons, we need to provide better information about what they’re
   for and when you should or shouldn’t use them. For example, you can and are able
   to use the Algolia dashboard to set everything, but if someone were to click 
   one of these buttons, then those dashboard-managed settings would get overwritten.
   So it’s best to go with one or the other, not both.
 * That said, there’s reason to consider going with the code version and the settings
   pushing. It allows you to version control configuration and help aid in many 
   people working on the site to have consistent settings. Much easier than manually
   going through indexes and re-setting things.
 *  Thread Starter [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * (@laurentfrom47)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400404)
 * OK, i ‘ll see that, thanks Michael.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Add Synonyms functions.php’ is closed to new replies.

 * ![](https://ps.w.org/wp-search-with-algolia/assets/icon-256x256.png?rev=2894668)
 * [WP Search with Algolia](https://wordpress.org/plugins/wp-search-with-algolia/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-search-with-algolia/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-search-with-algolia/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-search-with-algolia/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-search-with-algolia/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-search-with-algolia/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [laurentfrom47](https://wordpress.org/support/users/laurentfrom47/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/add-synonyms-functions-php/#post-16400404)
 * Status: resolved