How to hide an exposed filter block if the view results are empty?
@pierre's answer is a good one, however $view->total_rows is not always populated.

So you could do something like this instead, which will work no matter what:

function MODULE_views_pre_render(&amp;$view) {
  if ($view-&gt;name == 'VIEW_NAME' &amp;&amp; $view-&gt;current_display == 'DISPLAY_NAME') {
    if (empty($view-&gt;result) &amp;&amp; empty($view-&gt;getExposedInput())) {
      $view-&gt;exposed_widgets = NULL;
    }
  }
}