How to Redirect to Post if Search Result Returns Only One Match

When someone searches your blog using WordPress built-in search engine, the results are displayed as a list. Wouldn’t it be nice if we can redirect the visitor directly to the post when there is only one match in the search list? Here is a snippet can do just like that.

Copy and paste the following code snippet into your functions.php file, or your own plugin.

 

Comments are closed.

Post Navigation