When using the_search_query to display search result on my site, the spaces between words are displayed with a + symbol.
So if a visitor searches for "wordpress plugins" the_search_query output in search.php returns
How can I remove the + symbol, and/or replace it with non-break space entity, like so .....
wordpress plugins or wordpress plugins
I tried this approach but it is not working .....
<?php $string = the_search_query(); $res = preg_replace("/[^a-zA-Z]/", "", $string); echo $res; ?>