Categories
PHP Wordpress

WordPress : Redirect To Post Page When Search Query Returns Single Result

You may have noticed that when there is only one search result then user need to click on the title of that result to read more about that post. We can use the below function to redirect user to post page when there is only one search result.