Free tools Windows power users keep installed
One-click scans. No signup required.
To hide block types from selected editors in WordPress, filter the block types offered in the editor’s inserter with allowed_block_types_all and check the current user’s capability. This changes what users can insert; it does not remove blocks already in a post or hide published content from site visitors. If you mean either of those, use block locking or front-end visibility controls instead.
Choose what you need to hide
| Goal | Where the restriction applies | Approach |
|---|---|---|
| Stop selected editors adding block types | Editor inserter | Use allowed_block_types_all with a capability check. |
| Prevent editors changing or unlocking existing layout blocks | Editing actions | Use the Block Locking API and configure who can lock or unlock blocks. |
| Hide authored content from certain visitors | Front-end rendering | Use conditional visibility controls; an inserter restriction does not control what visitors see. |
The distinction matters: restricting blocks in the Gutenberg inserter controls block availability during editing, not permissions to view a published page.
Restrict block types with allowed_block_types_all
WordPress documents allowed_block_types_all as the server-side filter for available block types. It can return true, false, or an array of allowed block names. The older allowed_block_types filter is deprecated. See the Block Filters reference and WordPress Developer Blog’s guide to disabling specific blocks.
An allow-list is straightforward when a user should have access to only a small set of blocks. Use a capability that corresponds to the permission you intend to target rather than assuming every site’s roles are configured identically. WordPress’s current_user_can() reference explains capability checks, including how meta capabilities are mapped to primitive capabilities.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
Example: limit users who cannot publish pages
This example lets users with the publish_pages capability keep the default block availability and limits other users to a short list. Replace the block names with the ones appropriate for your site.
add_filter( 'allowed_block_types_all', function ( $allowed_blocks, $editor_context ) {
if ( current_user_can( 'publish_pages' ) ) {
return $allowed_blocks;
}
return array(
'core/paragraph',
'core/heading',
'core/list',
'core/image',
);
}, 10, 2 );
The hook passes the existing allowed-block value and editor context to the callback. Returning the existing value for users who should retain access avoids replacing the site’s existing behavior for those users. The official tutorial demonstrates conditional restrictions based on user capabilities and the edited post type; see its examples if the rule should also depend on post type.
When a disallow-list is easier
If users should retain most blocks and lose only a few, it may be easier to start with the available block list and remove selected names. WordPress’s tutorial includes both allow-list and disallow-list patterns, including conditions based on capability and post type. Choose the form that will be easiest for your site to maintain as its block set changes.
Where to put the code and how to verify it
- Confirm the target. Identify whether the restriction must apply in the Post Editor, Site Editor, or both, and note the site’s WordPress version and the relevant users’ capabilities.
- Add the filter in maintainable site code. Put the snippet in a small site-specific plugin or a child theme rather than editing a parent theme directly.
- Test with representative accounts. On a staging site, sign in as a restricted editor and an unrestricted editor, then check the inserter in the editor(s) you intend to control.
- Check existing content separately. Confirm that your intended rule concerns insertion only. Existing blocks and front-end display require their own controls.
Role names can be misleading on sites where roles have been customized by the site or plugins. Select a capability matching the action you want to govern, and verify the result using accounts with the relevant permissions.
Rank #3
Use a different method for existing blocks or visitors
Existing layout blocks: block locking
If editors may add a block but must not move, remove, or otherwise alter an existing layout, investigate the Block Locking API. WordPress documents block_editor_settings_all as a way to control locking permissions. Locking addresses editing actions; it is not a replacement for hiding block types from the inserter.
Published content: visibility rules
If the actual aim is to hide a block from logged-in users or show content only to particular visitors, use front-end visibility rules. The Block Visibility listing describes controls for specific users and roles. RenderWhen for Blocks describes conditions based on user state and role, along with role-preview functionality. These affect whether content is rendered for visitors, rather than which blocks editors can insert.
Rank #4
When a plugin interface may fit better
For a graphical, role-based setup instead of custom code, Block Editor Roles describes per-role controls over block insertion and editing, including limiting editing to text changes. Its WordPress.org listing, accessed in 2026, reported fewer than 10 active installations and compatibility tested up to WordPress 6.9.9; those are time-sensitive listing details, not a guarantee of current maintenance or compatibility. Check the current listing and test on your own WordPress version before relying on it.
Use a plugin only after confirming that its controls match the job: editor block availability, editing restrictions, and visitor visibility are separate functions. Availability and compatibility can change between plugin releases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




