MemberPress is fully compatible with the default WordPress Block editor (Gutenberg). Furthermore, you can use MemberPress rules to protect Gutenberg blocks on WordPress posts and pages designed with the Gutenberg editor. This way, you can hide Gutenberg blocks with your premium content, making it available only to active members.
This document will explain how to protect Gutenberg blocks with MemberPress using block-level protection or the Protected Content Block. These tools help you create pages where some content is free while others require specific memberships.
Why Protect Gutenberg Blocks?
Block-level protection lets you control access to individual blocks instead of entire posts or pages. This means you can:
- Show preview content to everyone while protecting premium sections;
- Hide Gutenberg blocks and create different content levels within the same page;
- Mix free and paid content together;
- Display membership-specific information within general posts.
Unlike protecting entire posts with MemberPress Rules, protecting individual blocks allows visitors to access the page. At the same time, you can hide Gutenberg blocks to keep the premium content hidden based on the user’s membership.
Furthermore, next to hiding content, you can show a login form or a custom message to prompt users to register.
Protect Gutenberg Blocks With MemberPress Rules
When you protect Gutenberg blocks, you can control which parts of the content visitors and members can access. Hence, you can create flexible content experiences with free and premium sections.
Regras do MemberPress define who can access specific content and what happens when unauthorized users try to view it. These rules work with both block-level protection and the Protected Content block to control access to your content.
Understanding MemberPress Rules
Quando using MemberPress Rules, it’s essential to mention that they contain two main components:
- Condições de acesso – Who can see the content (memberships, roles, capabilities, or specific members);
- Unauthorized actions – What happens when someone without access tries to view the content?
Thus, to protect content with MemberPress, you must create rules.
Creating MemberPress Partial Rules
O partial type of MemberPress rules works best for protecting specific blocks. These rules can be applied to multiple Gutenberg blocks and other content throughout the site.
Follow these steps to create a Partial rule:
- Navegue até Painel de controle > MemberPress > Regrase clique no botão Adicionar nova regra botão. Isso abrirá o formulário para a criação de novas regras.

- Abaixo de Conteúdo e acesso, clique no botão Conteúdo protegido dropdown and select the Parcial tipo de regra.

- Now, under Access Conditions, set the condition to Associaçãoe selecionar which membership should be required to access this page. You can click the + ícone under Access Conditions to add multiple conditions.
- Clique no botão Salvar regra button to save your partial rule.
Applying this rule to any content on your website will restrict access only to members subscribed to the set membership.
Protect Gutenberg Blocks Using Block-Level Protection
The Content Protection feature automatically appears in the block settings for every Gutenberg block when the MemberPress plugin is activated. These block-level settings allow you to protect any individual block directly.
Para enable the block-level protectionSiga estas etapas:
- Select a block you want to protect (text, image, heading, etc.).
- Navegue até a seção Block Settings panel on the right side.

- Find and expand the Content Protection seção.

- Clique no botão Access Rule dropdown, and start typing the name of the MemberPress rule you need. Click on the rule to apply it to the block.
- Sob o Se permitido dropdown, you can choose to Mostrar ou Esconder the block. Choose Show to allow authorized members to access and restrict the block content for other users. Conversely, if you choose Hide, you can hide Gutenberg blocks for authorized members and make them visible for everyone else.
- Sob o Acesso não autorizado dropdown, choose what the unauthorized users should see instead of the protected content:
- Esconder – Make the entire protected block and all the content inside invisible;
- Padrão – Apply the default Unauthorized Access settings you set for MemberPress
- Exibir mensagem – This option hides the content and displays your custom message instead. You will get the additional Mensagem não autorizada field to add your message.

- Salvar alterações by saving post updates (the Update or Publish button).
Protect Gutenberg Blocks Using the Protected Content Block
The Protected Content Block works as a container that wraps other blocks with membership protection. You can add any Gutenberg block to a Protected Content block. Also, the number of blocks you can add is unlimited.
The Protected Content block can be added within the Gutenberg editor as any other block:
- Navigate to the desired post, page, or widget areae clique em Editar to start the Gutenberg editor.
- Clique no botão Add Block button (+ icon) in the editor.

- Search for the block named Protected and select it. Now, you can add blocks you want to be protected within the protected content block.
- Click inside the Protected Content block área.
- Clique no botão Add Block button (+ icon) within the Protected Content block.

- Add any blocks you want to protect (paragraphs, images, videos, headings, lists). You can add multiple blocks inside one Protected Content block.
- Design the protected content. You can format and style each added block as usual (using the block’s available settings).
- Salvar post changes.
Protected Content Block Settings
Next, you should configure the block settings:
- Selecione o Protected Content block.
- No Block Settings panel, find the Access Rule seção.

- Choose a MemberPress rule from the dropdown.
- Abaixo de If allowed, select if the protected content should be shown ou hidden.
- Next, expand the Acesso não autorizado painel.

- Sob o Unauthorised Action dropdown, choose what the unauthorized users should see instead of the protected content:
- Somente ocultar – hide the entire protected block and all the content added inside;
- Mostrar mensagem – hide the content and display a custom message instead.
- Mostrar formulário de login – hide the protected content and show the MemberPress login form;
- Mostrar formulário e mensagem de login – hide the protected content and show the MemberPress login form and a custom message.
- You'll see the additional Mensagem não autorizada field if you choose the Mostrar mensagem ou o Mostrar formulário e mensagem de login opção. Add the custom message that should be displayed to unauthorised users to this field.
- Salvar alterações by saving post updates (the Update or Publish button).
Block-Level Protection vs. Protected Content Block
Each protection method offers distinct advantages depending on your content strategy and technical needs.
Block-level content protection advantages:
- Granular Control: Protect individual blocks precisely without affecting surrounding content. This allows for very specific content restrictions within complex layouts.
- Cleaner Editor Experience: No wrapper blocks cluttering your editor interface. Each block manages its own protection settings independently.
- Opções de layout flexíveis: Easily mix protected and unprotected blocks without restructuring your content layout or design.
- Simple Implementation: Apply protection directly to existing blocks without adding new block types or changing your content structure.
Protected Content block advantages:
- Group Management: Protect multiple related blocks together with a single-rule configuration. This simplifies management when protecting large content sections.
- Visual Organization: Protected content sections are clearly visible in the editor, making it easier to understand your content structure at a glance.
- Consistent Styling: Apply unified styling and messaging across all content within the protected container.
- Simplified Rule Management: Manage one set of protection rules for multiple blocks instead of configuring each block individually.
Choosing the Right Method to Hide Gutenberg Blocks
Uso block-level protection when you need precise control over individual elements and want to maintain clean editor layouts. This method works best for protecting specific paragraphs, images, or other elements within mixed content.
Uso Protected Content blocks when protecting related content sections together and wanting simplified rule management. This method works well for protecting entire sections or chapters in your articles that should have unified access requirements. In this case, it’s a more straightforward method than applying the same MemberPress rule to every block individually.
When choosing between these methods, consider your content strategy, editing workflow, and maintenance needs. Both approaches use the same underlying MemberPress Rules system, ensuring consistent protection regardless of your chosen implementation method.