Site offline notification How to turn off the notification about the site being offline, when in maintenance mode? 


  Operating in maintenance mode. Go online.
Before I give you the answer, I would suggest that you do NOT implement this.

This  message is an obvious but friendly reminder that your site is in maintenance mode. Turning off this reminder may leave you scratching your head later, wondering why anonymous visitor John Smith can't access your site. The reason may be obvious to you now but it may not be so obvious as time goes by.

This code snippet removes the 'Operating in Maintenance Mode' message, but preserves other messages. Place this code in template.php and then clear the cache:

function mytheme_preprocess_page(&amp;$vars) {
  if (variable_get('maintenance_mode', 0)) {
    $message_count = count($_SESSION['messages']['status']);
    if($message_count &gt; 1) {
      array_shift($_SESSION['messages']['status']);
    }
    else {
      unset($_SESSION['messages']['status']);
    }
  }
}


Edit: Updated the code, this should do the trick. Added a condition that unsets the 'status' element if empty.

One last thing: The maintenance message also appears on the administration pages. You can remove this message too, but as stated earlier, this is dangerous.

The default theme for the admin pages is 'Seven', which has its own template file. You could copy the above code into Seven's template.php. Or even better, copy the code into a new function in your custom module, mymodule_hide_maintenance_message() for example, and simply call that function within mytheme_preprocess_page.