Is it possible to redirect the user to the taxonomy page IF the search input matches the taxonomy name exactly?
For instance i have a taxonomy called “Actors”. If someone put into the search field “Tom Hanks” instead of going to the regular search page, it would redirect them to the taxonomy page for Tom hanks.
I only wanted to match tags in a single taxonomy, so I was able to simplify the code as follows. My taxonomy is ‘post_tag’ — just swap yours out as needed.
How about something along these lines?
Docs:
get_taxonomies()
,get_term_by()
,wp_redirect()