Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Block Exclude Pages

7,933 sites Security covered
View on drupal.org

This module allows you to exclude specific pages from block visibility settings. You can use a "!" prefix to hide blocks from certain paths, even if they are set to appear on broader patterns, or vice versa to show blocks on paths that are otherwise excluded.

This module adds an exclude pages filter for blocks.

Maintained by: @jcontreras
Support the module development at: https://buymeacoffee.com/vati

This module excludes specific pages after the wildcard or between wildcards; simply prefix the path pattern with a '!' in the block page visibility configuration.

Show - or - hide blocks on specific paths

This works for visibility set to "show for the listed pages"; in this case, the exclude paths will hide the block on pages that match, despite the wildcard set to show.

Or the other way around, if the page list is set to "hide for the listed pages," the excluded paths will show the block on pages where the pattern matches, despite the wildcard being set to hide.

Basic example where a wildcard is used to display the block on pages under the user path:

  /user/* <-- this will make the block visible on all pages under the path.

But let's say you want to exclude a specific page or another path directory under the path "/user/?":

  !/user/jc <-- now you will be able to specifically exclude the "jc" page

or/and:

  !/user/jc/* <-- exclude on all pages under "jc/?"

( Drupal 7 - No need for leading slashes on the URL as of Drupal 7 standards )

--- DRUPAL 10 Upgrade ---

Use this on your composer file:
"drupal/block_exclude_pages": "^2.0 || ^2.2"

Happy Coding!

Activity

Total releases
7
First release
Dec 2024
Latest release
3 months ago
Releases (12 mo)
3 ▼ from 4
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.2.2 Stable Apr 6, 2026
2.2.1 Stable Apr 3, 2026
2.2.0 Stable Oct 22, 2025
2.1.2 Stable Dec 9, 2024
2.2.0-alpha2 Pre-release Dec 6, 2024
2.2.0-alpha1 Pre-release Dec 5, 2024
2.1.2-alpha1 Pre-release Dec 5, 2024