and like us on FB

If you searched this website for “Jennifer L.awrence” (prior to this post), the search would have redirected you to the only page on this site that contains that text (“Determine A Person’s Age From DOB“). It’s a fairly specific search term and, given that there’s only one result, it’s pretty clear what the user is looking for. In such instances, what’s the point of generating a “list” of search results? The following code will detect a single search result and redirect the user to the only post or page that matched your search criteria. It’s arguably a better user experience and likely to convert a little better than the alternative.

WordPress Code

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

You can download the code as a function for your custom functions file (labeled as shortcode) or as a plugin below.


Download: Shortcode (V) | WP Plugin (V) |

Shortt URL for this post: