Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Block Exclude Pages

7,784 sites Security covered Drupal 10–11
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!

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
7
Tracked since
Dec 2024
Latest release
4 months ago
Releases (12 mo)
3 ▼ from 4
Maintenance
Active

Release Timeline

Releases

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