Skip to content

Instantly share code, notes, and snippets.

@searchwpgists
Created March 29, 2022 13:47
Show Gist options
  • Save searchwpgists/447de78df3ffa71095571773443b4c67 to your computer and use it in GitHub Desktop.
Save searchwpgists/447de78df3ffa71095571773443b4c67 to your computer and use it in GitHub Desktop.
Add Synonym to existing Synonyms in SearchWP
<?php
// Add Synonym to existing Synonyms in SearchWP.
add_filter( 'searchwp\synonyms', function( $synonyms, $args ) {
$synonyms[] = [
'sources' => 'seo',
'synonyms' => 'search engine optimization',
'replace' => false,
];
return $synonyms;
}, 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment