add_filter( 'asp_query_args', 'asp_replace_search_keywords', 10, 2 );
function asp_replace_search_keywords( $args, $id ) {
* Add as many words as you want. On the left side place the
* word or words separated by comma to replace.
* To the right side, place the single word to replace it with.
'word1' => 'word2', // Replace 'word1' with 'word2'
'word3, word4' => 'word5' // Replace 'word3' and 'word4' with 'word5'
// ----------------------------------------
// Do not change anything below this line
// ----------------------------------------
foreach ( $replace as $k => $w ) {
foreach ($kr as $krk => &$krv) {
$krv = '/\b' . $krv . '\b/u';
$args['s'] = preg_replace($kr, $w, $args['s']);