Rules Overview
MemberPress Rules Intro
MemberPress ignores all rules when the current user has administrative rights. When testing rules, ensure you are not using an admin user.
MemberPress Rules are your go-to for content protection, enabling you to easily paywall your most valuable asset! Rules let you specify who gets access to your premium content, ensuring it's reserved for the right audience. Perfect for paywalling with precision and peace of mind!
The video below features a basic run-through of MemberPress Rules and associated settings.
MemberPress URI Rules Explained
The following video features a more in-depth explanation of MemberPress Custom URI Rules.
How to Restrict Content to Specific Membership Types in MemberPress
This video shows you how to restrict (or paywall) content to a certain membership using an “All Content Tagged” rule.
Member Specific Rules
MemberPress supports per-member rule settings (not shown in the above videos). When creating or editing your rule, you can now select from the first drop down in the Access Conditions section. Selecting "Member" will allow you to type in the username of a user you would like to have access through that rule. This can be in addition to any other condition(s) that you may have for the rule.
Note: by adding a specific member to a rule, they will have access to the specified content regardless of membership status. Meaning, the user does not need to be subscribed to any membership, to still gain access to the content. Where possible, we recommend that you protect your content based on your Memberships, not based on individual members, however you may have a specific use case where this comes in handy.
Roles & Capabilities Rules
MemberPress also allows you to specify content protection Rules based on a user's WordPress Role(s) and/or Capabilities. We don't typically recommend using these unless you have a very specific reason to do so. Such as migrating from Members to MemberPress and maintaining the existing accesses you had based on roles/capabilities. Where possible, we recommend that you protect your content based on your Memberships, not based on Roles or Capabilities.
A Basic Breakdown of MemberPress Rules
After you have created at least one Membership, you can then set up Rules to protect certain pieces of site content from non-subscribed members. The following options are available for Rules.
Important Note: Administrators can always access content, regardless of the Rules, so be sure to do your testing with non-administrator User accounts.
Note: The Tagged and Categorized rules will only look at the taxonomy (i.e. category or tag) so any post type using that category or tag will also be protected by the rule.
- All Content - This allows you to paywall all content. However, it is not as easy as it seems. You should exclude certain MemberPress pages that need to stay public for the proper functioning of your website. Those include (but are not limited to), Login page, Account page, Membership registration pages, Thank You pages, and the Unauthorized redirect page (if set).
You might need to add some other, non-MemberPress related pages to the exclusion list, like "Contact Us", "About Us" and similar, but that is entirely up to you.
- All Content Categorized - Same as above, but protects all content based on a category applied.
- All Content Tagged - Same as above, but protects all content based on a tag applied.
Please note that the "All Content" and its variations apply only to standard WordPress content (posts and pages). This does not apply to BuddyPress/BuddyBoss generated content and Custom Post Types that come from plugins other than MemberPress.
- A Single Post - This allows you to paywall one individual post.
- Posts Categorized - This allows you to protect any post(s) which has been assigned a certain category. Using categories in WordPress is a great way to keep your membership content organized.
- Posts Tagged - This allows you to protect any post(s) which has been tagged with a specific tag. This is similar to the Categories rule but gives you a bit more control over how you want to organize your membership content.
- All Posts - This allows you to protect all posts on your site at one time. Be sure to use this option with caution as it can conflict with other Rules you may have set already, such as "A Single Post", "Posts Categorized", or "Posts Tagged".
- A Single Page - This allows you to paywall one individual page.
- Child Pages of - This allows you to protect all children of the selected page. A child page in WordPress is any page in which you set a "Parent" value when creating/editing the page.
- All Pages - This allows you to protect all pages at once. Be sure to use this option with caution as it can conflict with other Rules you may have set already, such as "Child Pages of" and "A Single Page".
Please note that special WordPress pages like Homepage, Posts page, Category page, Archive page etc. are not affected by these page rules. To protect those, you'd need to use the Custom URI rule instead.
- Partial - Select this option if you only plan to use this rule to hide partial content with the use of a Shortcode or PHP Snippet (See here)
- Custom URI - Allows you to protect files and pages by what's in the URL. Note: Protecting Files does not work the same on all server types. Read this page for more information on protecting files.
- Custom Post Type - Any custom post types that you have created will appear in the drop-down menu when selecting rule type. You will have the option to protect any of the custom post types based on all custom post types or one individual custom post for the one you have selected.
Account page advice: We recommend excluding the Account page from any rule because it is, by default, inaccessible to non-logged-in visitors of your website. If you protect that page additionally, once a member's subscription expires, they would not be able to access the Account page in order to update their credit card details, for instance. That will create more work for you and will not contribute to data protection in any way.
Drips and Expiration's - For a more detailed explanation of how these settings work, please see this page. You can set a time for the Rule to drip (become available) or expire (become unavailable) based on any "X" amount of days, weeks, months, or years after a trigger has been made. The triggers you can select are when the member registers (meaning on your site), after a fixed day in the future, or after they purchase any or a specific membership on your site (all created memberships will appear as options). So let's say you have 12 protected posts, and you want the member to have access to only one post per month after they signup. Well enabling drips and expiration's will allow you to do this easily, and much more.
Redirecting Unauthorized Users - If you would like to redirect unauthorized users to a specific page instead of just showing them your default or custom unauthorized message on the page they are visiting, then you can enable that option in your MemberPress > Settings > Pages > Unauthorized Access section. If you are considering using this option, we strongly suggest you check out our video found on this page.
Advanced Options - Advanced users may also be interested in our PHP Snippets and Regular Expressions.