Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Remove status messages

Security covered Maintenance fixes only 24 sites

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.

Drupal 10–11

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.

Activity

Tracked releases
2
Tracked since
Feb 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0 Stable 10–11 Jun 12, 2024
1.0.x-dev Dev 10–11 Feb 18, 2024