Restrict Content

Memberships adds a “Require Membership” box to your “Edit Page” screen allowing you to control access for each active membership level (public and hidden).

The logic for determining who has access to page works as follows: #

  1. If no levels are checked, the page is available to all users whether they are members or not or logged in or not.
  2. If one level is checked, only users logged in with that membership level will be able to view the page.
  3. If multiple levels are checked, users logged in with any of the checked membership levels will be able to view the page.

If you have multiple “tiered” levels, make sure that your higher tiers are checked on lower tier content. For example if you have a free level with access to some content and a paid level with access to “everything”, make sure that on your “free pages” both the free and paid membership levels are checked.

Message for Non-members and Logged-out Users #

When users without the required membership visit a post with level requirements, they will see the non-member or logged-out member message. These messages can be updated from the Memberships > Advanced Settings page.

Set Access at the Category Level #

Setting a Membership Level's Restricted Categories
Restrict a category for a specific membership level.

Once you have set up your members-only categories you can edit the membership levels via the “Memberships” admin page. At the bottom of the Add/Edit Membership Level screen you will see a section titled “Content Settings”. Check the boxes for each category that level is allowed to view.

When users without the required membership visit a post with a category restriction, they will see the non-member or logged-out member message. These messages can be updated from the Memberships -> Advanced Settings page.

Screenshot example of a restricted post "no access" message.
Screenshot example of a restricted post “no access” message.

If you are restricting entire categories, you may want to update the “filter searches and archives” option from the Memberships -> Advanced Settings page or visitors will get 404s when viewing an archive view of that category. Read our blog post here for more information on this setting.

Set Access Per Post #

Setting a Page or Post's Required Membership Levels
Restrict a post for a specific membership level.

Alternately, if you want to set restrictions at the per-post level, you can use the “Require Membership” box to toggle access for an individual post. Note that restrictions are “cumulative” so if the post is locked at the category to level B, you can set it on the single post level to also include level A (in this scenario both Level A and B would have access).

Use the Membership Required block to restrict access to nested block content for specific Membership Levels or for non-members only. The block settings allow you to swap the block content with the message for non-members as defined under Memberships > Settings > Advanced.

How it Works #

To use this method of restricting content, insert the “Membership Required” block into your post or page content.

The block has settings to choose which Membership Levels should have access to view the nested block content. Or, set this block of content to show for non-members only as a great way to promote your membership plans.

If a visitor or user accessing that post does not have the required access, the entire area of content will be hidden. You can optionally show the ‘no access’ message in place of this members content by selecting “Show the ‘no access’ message” in block settings.

There is no limit to how many of this block can be used in a single piece of content. Place multiple blocks each with customized content based on the user’s status for ultimate personalization.


Screenshot #

Screenshot of the Membership Required block in the WordPress editor.

Memberships includes one shortcode for restricting access to content. Place these in any post or widget to show certain content to certain membership levels.

[membership level="1"]Will only show up for level 1 users.[/membership]

[membership] Shortcode Attributes #

This shortcode has two attributes you can use to specify which levels to display the content for as well as an optional “delay” to show the content after a specific timeframe.

  • level: The level ID to show or hide this content from. Accepts “0” for non-members, a single level ID, a comma-separated list of IDs, or a negative value to hide for a specific level. Leave the ‘level’ attribute blank to show the content to all members and hide it from non-member users and visitors.
  • delay: Optionally set a delay in number of days to reveal this content at a future time calculated based on the member’s start date for their active membership level.
  • show_noaccess: Optionally swap content for the appropriate non-member access text as defined under Memberships > Settings > Advanced > Message Settings. Set the attribute to “true” to display the message. The default behavior will not show any swapped message.
[membership level="1" show_noaccess="true"]
	Will only show up for level 1 users.
	Others will see the no access message.
[/membership]
[membership level="1,2,3"]
	Only show for level 1, 2, or 3 users.
[/membership]
[membership level="0,-1"]
	Show for anyone not in level 1, including non-members and visitors.
[/membership]
[membership level="1" delay="7"]
	Will show up for level 1 members, 1 week from their start date.
[/membership]
[membership level="0"]
	Will show up for non-members and non-logged in site visitors.
[/membership]