Block Availability Control
A WordPress plugin for controlling which Gutenberg blocks are available to users, with support for WordPress multisite and PublishPress Capabilities.
by Stephen Schrauger · github.com/hashbangcrash/block-availability-control
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/hashbangcrash/block-availability-control/archive/refs/heads/main.zipReadme
Block Availability Control
A WordPress plugin for controlling which Gutenberg blocks are available to users, with support for WordPress multisite and PublishPress Capabilities.
Features
- Disable Gutenberg blocks on individual sites.
- Disable blocks network-wide on WordPress Multisite.
- Network-disabled blocks are automatically disabled across all sites.
- Administrators can bypass block restrictions.
- Create a PublishPress Capabilities override for each disabled block.
- Grant individual roles permission to use specific disabled blocks.
- Does not override restrictions imposed by other plugins or filters.
- Provides searchable and filterable block management screens.
How It Works
Blocks can be disabled from:
- Settings -> Block Availability - for the current site.
- Network Admin -> Settings -> Block Availability - for the entire network.
When a block is disabled, the plugin generates a capability such as:
bac_use_block_core_paragraph
If PublishPress Capabilities is installed, these capabilities appear under the Block Availability section.
Granting a capability to a role allows users with that role to use the corresponding block despite it being disabled by Block Availability.
Example
If core/paragraph is disabled, the plugin creates:
bac_use_block_core_paragraph
You can then grant that capability to a role through PublishPress Capabilities.
The plugin will allow that user's Paragraph block while continuing to enforce restrictions on users without the capability.
Multisite
The plugin supports WordPress Multisite.
Network restrictions
A block disabled from Network Admin is disabled on every site in the network.
Network-disabled blocks cannot be enabled from an individual site's Block Availability settings.
Site restrictions
Individual sites can disable additional blocks without affecting other sites.
The effective disabled list is the combination of:
Requirements
- WordPress 5.8+
- PHP 7.4+
- Gutenberg / Block Editor
- PublishPress Capabilities is optional
PublishPress Capabilities is only required if you want to assign block override capabilities to specific roles.
Capabilities
Capabilities use the following naming scheme:
bac_use_block_<block-name>
For example:
| Block | Capability |
|---|---|
core/paragraph |
bac_use_block_core_paragraph |
core/image |
bac_use_block_core_image |
core/gallery |
bac_use_block_core_gallery |
acf/example |
bac_use_block_acf_example |
Only currently disabled blocks are exposed to PublishPress Capabilities.
Read the full README on GitHub →
Releases
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.