block_exclude_pages
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!