Last updated January 13th, 2026 at 07:26 pm
When building access rules in MemberPress, one of the easiest ways to avoid chaos as your site grows is to rely on custom taxonomies. Another is to use custom user roles.
In this article, I’ll explain the benefits of each approach; how to implement them; and how, when used together, they can make your life immensely easier.
(If, when reading this article, you like the general strategy but find it a bit out of your wheelhouse, I welcome a discussion with you to see if and how I could help.)
- add it to a script file in the
/wp-content/mu-plugins/directory (recommended) - add it as a standalone plugin to your
/wp-content/plugins/directory - add it to the
functions.phpfile in your site's child theme directory - use a code snippets plugin such as Code Snippets
- add it to the
functions.phpfile in your theme directory (discouraged)
Fictional Membership Scenario
Let’s set the stage.
- Suppose you have three memberships: Bronze, Silver, and Gold.
- Suppose each membership has two membership plans: Monthly and Annual.
- Suppose the memberships are cumulative: both Silver plans include everything in the Bronze plans, and both Gold plans include everything in the Silver plans.
- Suppose you need to protect four (4) types of content: posts, pages, courses, and videos (a CPT).
Method #1: The Old-Fashioned Way of Writing MemberPress Rules
The truly old-fashioned way to create access rules in this scenario would be to individually target specific posts, pages, courses and videos.
Let’s just take a course called Introduction to Needlepoint. Being an introductory course, this is available to members with active Bronze, Silver, or Gold memberships.
Using this individual-targeting method, you’d have to write a rule for the course like this (keep in mind that the memberships are cumulative):
A Single Course : Introduction to Needlepoint
Membership is Bronze Monthly or
Membership is Bronze Annual or
Membership is Silver Monthly or
Membership is Silver Annual or
Membership is Gold Monthly or
Membership is Gold Annual
Now keep in mind that every course, every post, every page, and every video that can be accessed by anyone with either a Bronze, Silver, or Gold membership (either Monthly or Annual) will need a similar rule created.
Consider the implications!
This means that if there are four (4) such courses, ten (10) such pages, twenty (20) such posts, and six (6) such videos, you’ll be writing a total of forty (40) rules that look just like the above rule just for the stuff that Bronze members can access!
This also means that any time you add a 5th course or an 11th page or a 21st post or a 7th video — you’re going to have to add a new rule for each addition.
But there’s more!
If at some point you decide to add a new payment plan — say, the semi-annual plan — for each membership, you’re going to have to edit each of the 40 rules and add 3 more access conditions to each one of them!
Your new rule just for the Introduction to Needlepoint course will look like this (highlights indicate additions):
A Single Course : Introduction to Needlepoint
Crazy, right? That’s just one of the forty rules you’ll have to edit. Just one.
But there’s still even more…
So far, all we’ve talked about is content available to the starter membership (Bronze).
You’re going to have to create similar sets of rules for all content that Silver members can access and all the content that Gold members can access.
If you haven’t yet gotten the picture that building MemberPresss access rules the old-fashioned way is not the way to go, I’m not sure how I could convince you.
So, what’s a WordPress developer to do?
Method #2: Implement a Custom Taxonomy!
What if I told you you could reduce the number of rules in our fictional membership scenario from 40 to 3 simply by creating and using a custom taxonomy?
(And let’s not forget that the 40 rules number will grow as soon as you add new pages, posts, courses, or videos that need to be protected.)
Here’s how to create and use a custom taxonomy, and then you’ll understand how this enhancement will vastly improve your process of creating and managing MemberPress rules.
How to create your custom taxonomy
We’re going to create a new custom taxonomy called Access Category (with a slug of access-category). This taxonomy will be usable for all post types that will be protected by MemberPress.
There are two steps:
Step 1: Register the taxonomy.
function nwb_register_taxonomy_for_rules() {
/*
* This will enable writing rules targeting
* 'All Content with Access Category...'
* Abridged listing of array elements here
*/
$labels = array(
'name' => 'Access Categories',
'singular_name' => 'Access Category',
'menu_name' => 'Access Categories',
'all_items' => 'All Access Categories',
'add_new_item' => 'Add New Access Category',
'edit_item' => 'Edit Access Category',
'update_item' => 'Update Access Category',
'view_item' => 'View Access Category',
'add_or_remove_items' => 'Add or remove Access Categories',
'search_items' => 'Search Access Category',
'items_list' => 'Access Categories list',
'items_list_navigation' => 'Access Categories list navigation',
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_in_rest' => true,
);
register_taxonomy( 'access-category', array(
'post',
'page',
'mpcs-course',
'video',
), $args );
}
add_action( 'init', 'nwb_register_taxonomy_for_rules', 0 );
Notes:
- Line 23: This makes the taxonomy act like standard WordPress categories. That is, they’ll appear in the Quick Edit form and in the post editor sidebar area when using the classic editor.
- Line 28:
show_in_rest => truemakes the custom taxonomy UI appear in the post editor’s sidebar when using the block editor - Lines 31-34: These are the post types to which the custom taxonomy applies.
Step 2: Associate your custom taxonomy with the appropriate post types.
This may look redundant (and it may be). So, this is optional but recommended.
function nwb_add_taxonomies_to_objects() {
register_taxonomy_for_object_type( 'access-category', 'post' );
register_taxonomy_for_object_type( 'access-category', 'page' );
register_taxonomy_for_object_type( 'access-category', 'course' );
register_taxonomy_for_object_type( 'access-category', 'video' );
}
add_action( 'init', 'nwb_add_taxonomies_to_objects' );
Why optional? The register_taxonomy function might have already associated the access-category taxonomy with those post types. However, because the load order of actions can be unreliable, a belt-and-suspenders approach is best.
How to implement your custom taxonomy
Now it’s time to put the custom taxonomy to work.
And it’s incredibly simple.
Step 1: Decide what terms you want to use.
You’ve got three (3) memberships. The fact that each has a monthly and an annual payment plan (and might have other payment plans in the future) is irrelevant.
So, how about we use the following for the access-category taxonomy terms:
- Bronze Level
- Silver Level
- Gold Level
Step 2: Assign terms to posts.
Assign the appropriate access-category terms to each post (post, page, course, and video) you want to protect. This is just like adding categories and tags to blog posts and pages.
Here’s a screen shot from a website using the Access Category custom taxonomy (classic editor mode).

Step 3: Create the MemberPress rules
This is the fun part. This is where all your hard work is going to pay off.
Instead of creating rules whose rule type is “A Single Post” or “A Single Page” or “A Single Course” or “A Single Video”, you’ll select “All Content With Access Category” as the rule type.
And here are the only three rules you’ll need:
For Bronze Level:
All Content with Access Category : Bronze Level
Membership is Bronze Monthly or
Membership is Bronze Annual or
Membership is Silver Monthly or
Membership is Silver Annual or
Membership is Gold Monthly or
Membership is Gold Annual
For Silver Level:
All Content with Access Category : Silver Level
Membership is Silver Monthly or
Membership is Silver Annual or
Membership is Gold Monthly or
Membership is Gold Annual
For Gold Level:
All Content with Access Category : Gold Level
Membership is Gold Monthly or
Membership is Gold Annual
Pretty good, right?
But what if I told you we can further simplify the rule-making process by introducing custom roles into the mix?
Method #3: Combine Custom Taxonomy with Custom Roles
By introducing custom roles into the mix, we’ll still need the three (3) rules for our fictional scenario, but the process for creating and managing MemberPress rules will be simplified further.
Namely, we’ll need fewer access conditions and, more importantly, we’ll never need to edit any rules if and when payment plans are added or removed from any of the memberships.
First we’ll create three new custom roles, named “Bronze Member”, “Silver Member”, and “Gold Member”. (I’ll show you how in a minute.)
Then we’ll edit each membership to associate the appropriate user role with it. (I’ll show you how in a minute.)
Finally, we’ll create new rules (to replace the ones in Method #1 and Method #2) using Role as the access type. And the result will look like this:
The new rules using custom taxonomy and custom roles
For Bronze Level:
All Content with Access Category : Bronze Level
Role is Bronze Member or
Role is Silver Member or
Role is Gold Member
For Silver Level:
All Content with Access Category : Silver Level
Role is Silver Member or
Role is Gold Member
For Gold Level:
All Content with Access Category : Gold Level
Role is Gold Member
Once again, the beauty of this approach is that we’ll never need to edit any rules if and when payment plans are added or removed from any of the memberships. You could add a Gold Quarterly plan, a Gold Semi-Annual plan, a Gold Lifetime plan, or whatever — and the rule for all content with the access category of Gold Level would never have to be updated because each of those Gold membership payment plans would be associated with the Gold Member user role.
How to create the custom user roles
Create custom roles with a role editor plugin (I recommend Members).
Roles and capabilities can be created and managed with code, but I recommend you install and use the Members plugin, originally developed by Justin Tadlock and acquired around 2021 by Caseproof, the company behind MemberPress.
The new roles you’ll be creating (Bronze Member, Silver Member, and Gold Member) will not have any special WordPress capabilities.
Users with these roles will not be able to install plugins, edit posts, upload files, delete users, or anything like that.
Their only superpower will be to have access to protected content, which is handled by the MemberPress rules system.
For this reason, creating these custom roles is extremely simple. Here are the steps:
- Activate the plugin.
- Navigate to Members > Add New Role.
- Enter the name of the role.
- Click the Add Role button in the sidebar.
- That’s all there is to it.
This new role will have the same capabilities as the WordPress subscriber role — which is essentially nothing. You will not be granting any additional capabilities to this role using the Members plugin interface.

You will do this for Bronze Member, Silver Member, and Gold Member.
How to associate custom user roles with memberships
Here is the final piece, and this one is easy, too!
In the dashboard, navigate to MemberPress > Memberships.
(Here are the instructions for the Bronze Membership. Rinse and repeat for the Silver and Gold memberships.)
- Click Edit for the Bronze membership.
- In the Advanced tab of the Membership Options section, checkmark User Roles for this Membership.
- A multi-select box will open up. Find Bronze Member in the list of roles, and click it to select it.
- Update the membership.
- That’s all.

Summary
Here are some important factors that make this solution useful:
- Custom Taxonomies allow us to radically streamline the process of creating and managing MemberPress rules by obviating the need to ever target single posts of any type.
- MemberPress allows us to assign WordPress roles to members on a per-membership basis. This is a dynamic process. When a user’s membership becomes inactive, the role associated with that membership is automatically removed from that user.
- MemberPress allows us to create access conditions in rules using Role as the access type. This greatly simplifies the rule-management process, obviating the need to add or remove membership payment plans from rules’ access conditions.
- Role editor plug-ins such as Members make it easy to create and manage custom roles and capabilities. (Roles and capabilities can, of course, be created and managed with code.)
Like what you see? Share with others and join my mailing list. No long-term commitment, unsubscribe any time.

Leave a Reply