Customizing the WordPress Search Results Page

If you ever encountered the limits of the build-in search of WordPress, you might consider to customize the output of the search results.

If a search produces no results, you could suggest the visitor to go to Google to do a search on your site with the same query.

To implement this, add (or modify) the content-none.php file of your theme (if you have a theme based on one of the default themes twentyfifteentwentyfourteen or twentythirteen like I have).

In the content-none.php php-file I added this text (&code) to the text which starts with “Sorry, but nothing matched your search terms.”:

<a href="'.get_site_url().'&q='.get_query_var('s').'">Or search with Google</a>.