Hide title if 404 error I have a custom 404 error page, and I just want a quick module that hides the 404 page title, if the user arrives at a 404 error. 

I've found a D7 function that looks like it would work, checking for '404 Not Found' in the http header, and adding a class that I can target with CSS. But I'm not sure how I'd do something like this for D8.

Here's what I've got: 

function MYMODULE_preprocess_html(&amp;$variables) {
  $headers = drupal_get_http_header();

  if (isset($headers['status']) &amp;&amp; $headers['status'] == '404 Not Found') {
    $variables['classes_array'][] = 'page-404';
  }
}
I don't think you need a custom module for something like this...
This should be as easy as:


Go to Configuration -&gt; System -&gt; Basic Site Settings, get the page URL you have for the 404 page.
Go to Structure -&gt; Block Layout, edit the 'Page Title' block, and exclude it under the Visibility section, by page URL from step1.