How can you hide "Your search yielded no results." when no keywords have been entered on the search page? On the core default search page located at /search/node, if you visit this URI the page displays "Your search yielded no results." It displays this message whether keywords have been entered that truly have no search results, as well as when no keywords have been entered. It is odd to be presenting "Your search yielded no results." to users when they have yet to actually search for anything. 

What's the most appropriate way to remove this message when no keywords have been entered?
First find out how this string got there in the first place. Simply search your codebase for the exact string Your search yielded no results.. In a Vanilla Drupal you'll find only 6 occurrences of this string. 5 of them in tests, and only one in a controller, the SearchController.

Looking into the SearchController you'll see that this string is part of a render array. Keyed as '#empty' and themed with '#theme' =&gt; ['item_list__search_results__' . $plugin-&gt;getPluginId(), 'item_list__search_results'],. This means you can target that pretty easily with a preprocess function. Let's go for item_list__search_results since you don't know of any plugin yet.

In your theme or module implement hook_preprocess_HOOK. Replace hook with your theme or module machine name and HOOK with the '#theme' key from earlier.

Now find out if any search query has been entered at all via if \Drupal::request()-&gt;query-&gt;has('keys'), and for safety let's also check if there's an 'empty' key in the $variables and then unset it. If you want you can tighten the condition now also on the plugin you'll find in $variables['context']['plugin'].

/**
 * Implements hook_preprocess_HOOK().
 */
function MYMODULE/MYTHEME_preprocess_item_list__search_results(&amp;$variables) {
  // ksm($variables);
  if (!\Drupal::request()-&gt;query-&gt;has('keys') &amp;&amp; isset($variables['empty'])) {
    unset($variables['empty']);
  }
}


Hint: Use the Devel sub-module Kint and its debugging function ksm() to have you any variable pretty-printed in the messages block of your site for easy debugging.