Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

block_exclude_pages

7,701 sites Security covered
View on drupal.org

This module adds an exclude pages filter for blocks.

To exclude specific pages after the wild card or in between wildcards, simply prefix the path pattern with a prefixed '!' 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 the 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 wild card 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
1 week ago
Release cadence
81 days
Stability
57% stable

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