Skip to content

Restrict Content for blocks

The Restrict Content Addon can control who sees each block on a page or post, based on whether the visitor is logged in, their role, their access levels, or their custom user field values. The addon requires a Plus or Elite plan; see Installing the Restrict Content Addon. Access levels are created at Automator > Settings > Addons > Restrict content, as described in Managing Access Levels.

Restrict a block

While the addon is active, every block in the block editor has a Restrict Block Access panel in the block settings sidebar.

Select the block, open the panel, and turn on Users must be logged in to view this block. The other controls appear once it is on:

Restrict Block Access Sidebar

  • Required role — the user needs at least one of the roles you select.
  • Required access level — the user needs at least one of the access levels you select.
  • Required custom user data — rules added with Add rule, each a Custom field and the Value it must hold. The user must match every rule. This control appears only when the Custom User Fields Addon is active and has at least one field.
  • Restricted content message — what visitors who don’t qualify see instead of the block.

Leave a control empty to skip it. A visitor sees the block only when they meet every requirement you set.

What other visitors see

  • If Restricted content message has text, that message appears in place of the block. It can include HTML and shortcodes.
  • If the message is empty, the block is not output at all, so visitors don’t know it exists.

Note: Administrators always see every block on the front end, even when they don’t meet the requirements.

Related: Managing Access Levels, Restrict WordPress Pages & Posts, Restrict Content Shortcodes, Restrict Content integration: triggers, actions, conditions and loop filters

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top