WordPress Search Query
Here are instances when a WordPress blog search returns just one item. This might be the thing the user was seeking for anyhow, depending on how well organized your site is. When a search query returns only one match, one of our users enquired as to whether there was a method to redirect to the post. We’ll teach you how to send people to the content when a search only finds up one match in this article.
Simply open the functions.php file for your theme and paste the following code.
Be aware that not all users will be expecting this functionality. So they might be terrified.