Remove status messages
There is, by default, no way to totally remove status messages from a page.
Even if the Messages block is disabled or removed from the page theme, Drupal inject the status messages in the page via the BlockPageVariant build method:
// If no block displays status messages, still render them.
if (!$messages_block_displayed) {
$build['content']['messages'] = [
'#weight' => -1000,
'#type' => 'status_messages',
'#include_fallback' => TRUE,
];
}
This module implements a hook_preprocess_page which removes the messages render array for a specific set of page URLs.
Use case: do not display status messages on a page triggering an immediate redirect, rather display them after the redirection has occured.
Issue credits will only be granted for significant contributions.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.