Customize the search "No Results" message

By default, searches that return no results display the text, "No results found":

You can customize the text in that message using this script.

Script

Go to Settings > Style, click on Custom HTML and select Body.

Copy the script text below and paste it into the Body window.


<script>
//customize the "no results" text on search results screen
$(function(){
  if($('.hg-search-page') && $('.hg-search-page').length > 0){
    $('.no-results-msg').html('<p>Replace this with the custom search text of your choice. You can style it using standard html</p>');
  }
});
</script>

This script will replace the "No results found" text in the screenshot above with the text between the <p> </p> tags. Update the text by editing the highlighted text above.

You can style the text in the script using html.

Sample

Not sure what to include? Some ideas include:

  • A link to your contact form
  • The email address of your support team
  • If you have a guide on how to use the knowledge base or specific guided search instructions, include a link to those

Here's a sample script:

And the output it produces: