Replace or remove characters from search phrase
add_filter('asp_query_args', 'asp_replace_characters', 10, 1);
function asp_replace_characters( $args ) {
$characters = "',._-?!"; // Type characters one after another
$replace_with = ' '; // Replace them with this (space by default)
$args['s'] = str_replace(str_split($characters), $replace_with, $args['s']);
return $args;
}$replace_with = ' ';$replace_with = '';PreviousReplace search keywords (whole words)NextAdding spaces in search phrase between alphabetics and numbers
Last updated