Docs Vector ExpressionsGuidesBlock Visibility FREE

Block Visibility

Block Visibility lets you show or hide any Gutenberg block based on a logic expression. The block is rendered or suppressed server-side — it never reaches the DOM when hidden, protecting both performance and sensitive content. Note that expressions entered in this input do not require surrounding brackets {{ }} - the input itself is a single expression.

Setting Up Visibility

  1. Select any block in the Block Editor.
  2. Open the Vector Expressions panel in the Block sidebar.
  3. Find the Visibility section.
  4. Choose either Show if True or Hide if True.
  5. Enter your expression.

Visibility Modes

ModeBehaviour
Show if TrueBlock is rendered only when the expression evaluates to truthy
Hide if TrueBlock is rendered only when the expression evaluates to falsy

Common Patterns

Show to logged-in users only

user.is_logged_in

Show to specific roles only

user.role == "administrator" || user.role == "editor"

Show on a specific post type

post.type == "product"

Hide via post meta flag

post.meta.disable_sidebar != "1"

Show based on membership tier

user.meta.membership_tier == "premium"

Security Note

Hidden blocks are not sent to the browser at all — they are removed from the output before the response is built. This means they cannot be accessed by users who inspect page source. Never rely on CSS-only hiding for sensitive content.