The solution for Drupal 7 is using the following code, as per answer of How can I disable the message “Operating in maintenance mode. Go online.” in maintenance mode?
function mytheme_preprocess_page(&$vars) {
if (variable_get('maintenance_mode', 0)) {
$message_count = count($_SESSION['messages']['status']);
if($message_count > 1) {
array_shift($_SESSION['messages']['status']);
}
else {
unset($_SESSION['messages']['status']);
}
}
}
What is the solution for Drupal 8?
I cannot figure out how to do it with https://www.drupal.org/project/disable_messages.
Hide/disable the message for everyone including the user #1.