How to strip/remove all blank spaces at the beginning/end of a search string

i agree w/ chip, you need trim()

i’d try replacing:


$keys = implode('|', explode(' ', get_search_query()));

with


$keys = implode('|', explode(' ', trim(get_search_query())));