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.

Supporting organizations: 
Development

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon19 sites report using this module
  • Created by mably on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases