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.
MemberPress-Regeln 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
Wenn using MemberPress Rules, it’s essential to mention that they contain two main components:
- Zugangsbedingungen – 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
Die 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:
- Navigieren Sie zu Dashboard > MemberPress > Regelnund klicken Sie auf die Schaltfläche Neue Regel hinzufügen Schaltfläche. Dadurch wird das Formular zum Erstellen neuer Regeln geöffnet.

- Unter Inhalt und Zugangklicken Sie auf das Symbol Geschützter Inhalt dropdown and select the Teilweise Regelart.

- Now, under Access Conditions, set the condition to Mitgliedschaftund Wählen Sie which membership should be required to access this page. You can click the + Symbol under Access Conditions to add multiple conditions.
- Klicken Sie auf die Regel speichern 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.
An enable the block-level protectionfolgen Sie diesen Schritten:
- Select a block you want to protect (text, image, heading, etc.).
- Navigieren Sie zum Block Settings panel on the right side.

- Find and expand the Content Protection Abschnitt.

- Klicken Sie auf die Access Rule dropdown, and start typing the name of the MemberPress rule you need. Click on the rule to apply it to the block.
- Im Rahmen der Wenn erlaubt dropdown, you can choose to anzeigen oder Ausblenden 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.
- Im Rahmen der Unbefugter Zugang dropdown, choose what the unauthorized users should see instead of the protected content:
- Ausblenden – Make the entire protected block and all the content inside invisible;
- Standard – Apply the default Unauthorized Access settings you set for MemberPress
- Meldung anzeigen – This option hides the content and displays your custom message instead. You will get the additional Unerlaubte Meldung field to add your message.

- Änderungen speichern 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 areaund klicken Sie auf bearbeiten to start the Gutenberg editor.
- Klicken Sie auf die 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 Bereich.
- Klicken Sie auf die 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).
- Speichern Sie post changes.
Protected Content Block Settings
Next, you should configure the block settings:
- Wählen Sie die Protected Content block.
- In der Block Settings panel, find the Access Rule Abschnitt.

- Choose a MemberPress rule from the dropdown.
- Unter If allowed, select if the protected content should be shown oder hidden.
- Next, expand the Unbefugter Zugriff Tafel.

- Im Rahmen der Unauthorised Action dropdown, choose what the unauthorized users should see instead of the protected content:
- Nur ausblenden – hide the entire protected block and all the content added inside;
- Nachricht anzeigen – hide the content and display a custom message instead.
- Anmeldeformular anzeigen – hide the protected content and show the MemberPress login form;
- Anmeldeformular und Nachricht anzeigen – hide the protected content and show the MemberPress login form and a custom message.
- You'll see the additional Unerlaubte Meldung field if you choose the Nachricht anzeigen oder die Anmeldeformular und Nachricht anzeigen Option. Add the custom message that should be displayed to unauthorised users to this field.
- Änderungen speichern 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.
- Flexible Layout-Optionen: 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
Verwenden Sie 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.
Verwenden Sie 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.