This module allows you to prevent status messages from being displayed on specific pages. It's useful for situations where you want messages to appear only after a redirect has occurred, rather than on the initial page load.
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.
Ask your assistant about Remove status messages
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
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.