Error Squelch
This module hides Drupal status, warning, and error messages based on configured patterns, reducing visual clutter from persistent or noisy notifications. It allows for substring or regular expression matching, with optional logging of suppressed messages and Drush commands for management. The module provides a test mode to verify its functionality.
Suppresses Drupal status, warning, and error messages whose text matches configured patterns. Useful for hiding persistent test-mode notices, CI/CD log noise, and chatty third-party module warnings that clutter screenshots, training videos, and on-call dashboards.
What it does
Filters $variables['message_list'] at hook_preprocess_status_messages() against an admin-configured list of patterns (substring or PHP regex). Matched messages are removed before the status messages template renders. Suppression is purely cosmetic; the underlying cause of any message is not addressed.
Key features
- Substring match (case-insensitive, default) or PHP regex with delimiters
- Optional logging of suppressed messages to the
error_squelchchannel for audit trails - Drush commands for managing patterns from the CLI:
drush error-squelch:list/add/remove(aliasesesl/esa/esrm) - Test mode injects a known status message visible only to users with the Administer Error Squelch permission, so operators can verify the filter is working before deploying patterns to production
- Modern Drupal patterns: OO hooks via
#[Hook],#config_targetthroughout the form, Drush 12+ command layout
When to use it
Reduce noise from known-benign messages while a proper fix is pending: a payment gateway's hardcoded "running in test mode" notice, missing-file warnings during an in-progress media sync, chatty contrib modules with unhelpful defaults. Not a substitute for fixing the underlying issue; the suppressed message is gone but the condition that triggered it isn't.
Requirements
- Drupal 10.3 or later, or Drupal 11
- No additional modules required
- Drush 11 or later (optional, only for the CLI commands)
What's next
Error Squelch is now covered by the Drupal Security Advisory policy.
Vulnerability reports go to [email protected]; see
the
Drupal Security Team procedures for the disclosure process. Do not
report security issues through the public issue queue.
No further behavioural changes are planned for the 1.0.x line; future
work will track Drupal core compatibility and any reported bugs.