Block Logic
Block Logic adds a "Block Logic" field to the block editor, that lets you show or hide any block based on conditions.
The facts
- Rating
- 5★ from 13
- Active installs
- 300+
- Price
- Free
- Last updated
- 30 May 2026
- Added
- Jan 2020
- Requires WP
- 6.5
- Tested up to
- WP 7.0.4
- Requires PHP
- 8.0
- Downloads
- 6,323
Our analysis
AI-assistedBlock Logic is a WordPress plugin that enhances the Gutenberg block editor by allowing you to control the visibility of blocks based on specific conditions. You can show or hide blocks using WordPress’ Conditional Tags or custom PHP code, making it suitable for users who need tailored content display based on various criteria such as user role or post status.
This plugin is designed for those who want to create dynamic layouts and content presentations without extensive coding. It offers flexibility in combining conditions and can be extended with additional filters, but it does not support certain block types, limiting its use in some scenarios.
Best for: This plugin suits WordPress users looking to customise block visibility in the Gutenberg editor.
What it does well
- ✓Allows conditional visibility for blocks
- ✓Supports user role and login status conditions
- ✓Can combine conditions with 'and' or 'or' operators
- ✓Easy to configure in the Gutenberg editor
- ✓Extensible with filters for advanced users
Where it falls short
- •Does not work with Classic Block or Widget Block
- •Limited to specific block types that support attributes
- •Requires PHP 8.0
Verdict
Block Logic provides a useful way to manage block visibility based on various conditions, but its limitations on block types may restrict some users.
From the developer
landwire's own description of Block Logic, lightly tidied.
Block Logic adds a “Block Logic” field to the “Advanced” section of the block editor (i.e Gutenberg), that lets you show or hide any block based on conditions. You can use WordPress’ Conditional Tags or any general PHP code.
Show or hide blocks based on
- User role
- User login status
- Post status
- Date and time
- The result of a custom PHP function
Features
- Show or hide any block using conditions
- Combine conditions with “and” or “or” operators. See FAQ Writing Logic Code
- Full flexibility: use any condition you want (you can extend base functionality with filters)
Limitations
Does not work with the Classic Block, Widget Block or Widget Area Block [‘core/freeform’, ‘core/legacy-widget’, ‘core/widget-area’], as the those blocks do not support block attributes. Does also not work with the HTML Block [‘core/html’] inside the Widget Screen, as this one also does not support block attributes there.
Configuration
Just activate the plugin. The “Block Logic” textbox will then appear in the “Advanced” section of the Gutenberg editor.
Breaking changes since 2.0.0
Since version 2.0.0 the code does not get eval’d directly, but there is a whitelist of allowed functions that can be extended via a filter.
Upgrade Notice
When upgrading to version 2.x you will need to update your logic. No return is allowed anymore and no semicolons in code as only expressions are evaluated. See FAQ Section Writing Logic Code.