• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

nSiteful Web Builders

Building a Better Web - One Site at a Time.

  • Home
  • About
    • Testimonials
    • Resources
    • Partner With Me
    • Frequently Asked Questions
  • Web Sites
  • Online Marketing
  • WordPress Support
    • Customized WordPress Training
    • 60-for-60 Sessions
  • Web Applications
  • Blog
    • At-A-Glance
    • Blog Articles Grouped by Category
    • Case Studies
    • General
    • Portfolio
    • Reviews
    • Snippets
    • Techniques
    • Projects
  • Contact
    • Purchase Retainer Consulting Hours
    • About Retainer Consulting Hours
    • Book a Meeting with Jeff
    • Tell Me About Your Web Project
    • nSiteful Newsletter Archives
    • nSiteful Rewards

By Jeff - 12/10/2025
Cats: Techniques · Tags: MemberPress, Membership Sites

techniques

MemberPress Rules Using Custom Taxonomies and Custom Roles

On This Page...

Toggle
  • Fictional Membership Scenario
  • Method #1: The Old-Fashioned Way of Writing MemberPress Rules
  • Method #2: Implement a Custom Taxonomy!
    • How to create your custom taxonomy
      • Step 1: Register the taxonomy.
      • Step 2: Associate your custom taxonomy with the appropriate post types.
    • How to implement your custom taxonomy
      • Step 1: Decide what terms you want to use.
      • Step 2: Assign terms to posts.
      • Step 3: Create the MemberPress rules
  • Method #3: Combine Custom Taxonomy with Custom Roles
    • The new rules using custom taxonomy and custom roles
    • How to create the custom user roles
    • How to associate custom user roles with memberships
  • Summary

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.)

Wherever I recommend adding code to your site, there are several ways you can do so, including:
  • 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.php file in your site's child theme directory
  • use a code snippets plugin such as Code Snippets
  • add it to the functions.php file 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):

Protected Content:

A Single Course : Introduction to Needlepoint

Access Conditions:

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):

Protected Content:

A Single Course : Introduction to Needlepoint

Access Conditions:
Membership is Bronze Monthly or
Membership is Bronze Semi-Annual or
Membership is Bronze Annual or
Membership is Silver Monthly or
Membership is Silver Semi-Annual or
Membership is Silver Annual or
Membership is Gold Monthly or
Membership is Gold Semi-Annual
Membership is Gold Annual

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.

Why not use built-in/default taxonomies? Firstly, not all post types (including Pages) support taxonomies. In addition, built-in taxonomies describe the topic of your content. Access categories describe who can see it. It’s best IMHO not to mix the two; using a separate Access Category keeps everything organized.

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 => true makes 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).

Access Categories for MemberPress rules

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:

Protected Content:

All Content with Access Category : Bronze Level

Access Conditions:

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:

Protected Content:

All Content with Access Category : Silver Level

Access Conditions:

Membership is Silver Monthly or
Membership is Silver Annual or
Membership is Gold Monthly or
Membership is Gold Annual

For Gold Level:

Protected Content:

All Content with Access Category : Gold Level

Access Conditions:

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:

Protected Content:

All Content with Access Category : Bronze Level

Access Conditions:

Role is Bronze Member or
Role is Silver Member or
Role is Gold Member

For Silver Level:

Protected Content:

All Content with Access Category : Silver Level

Access Conditions:

Role is Silver Member or
Role is Gold Member

For Gold Level:

Protected Content:

All Content with Access Category : Gold Level

Access Conditions:

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:

  1. Activate the plugin.
  2. Navigate to Members > Add New Role.
  3. Enter the name of the role.
  4. Click the Add Role button in the sidebar.
  5. 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.

Custom Roles for MemberPress Rules
Members plugin UI for adding new custom user role

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.)

  1. Click Edit for the Bronze membership.
  2. In the Advanced tab of the Membership Options section, checkmark User Roles for this Membership.
  3. A multi-select box will open up. Find Bronze Member in the list of roles, and click it to select it.
  4. Update the membership.
  5. That’s all.
Associating roles to memberships for managing MemberPress rules
Associate user role with membership

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.

Related Posts

  1. WordPress Custom Post Types: 6-Minute Video Summary
  2. Responsive Tables with Minimal CSS
  3. Custom MemberPress Pricing Pages
  4. Customize User Roles & Capabilities in WordPress: How (and Why)
  5. Use Case for Custom Post Type: “In The News”

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

mailchimp signup

Subscribe to get notified when new articles are published. Unsubscribe any time. No spam. I promise. Check out my newsletter archives.

social

Twitter Facebook LinkedIn

Recent Articles

  • Post-Specific CSS for WordPress October 5, 2026
  • You built an online course, but they haven’t come. September 16, 2026
  • Custom MemberPress Pricing Pages December 19, 2025
  • CSS Data Attribute Override December 11, 2025
  • MemberPress Rules Using Custom Taxonomies and Custom Roles December 10, 2025

Filter By Category/Tag

Categories

  • Case Studies (8)
  • For Staff (1)
  • General (73)
  • Portfolio (7)
  • Reviews (14)
  • Snippets (24)
  • Techniques (52)

Popular Tags

Advanced Custom Fields Blogging Child Themes Content Marketing CSS Customer Service Custom Fields Custom Post Types Diagnostics Domain Names Facebook FooGallery Genesis Hosting HTML Images iPhone Libra Live Chat Marketing Media MemberPress MemberPress Courses Membership Sites Mobile-Friendly MySQL Photo Gallery php Pinterest Plugins Post Formats Pricing Project Management SEBA SEO Seth Godin Shortcodes Social Networking Surveys Taxonomies Twitter Video Web design Web forms WordPress

Footer

Background

Web Sites | WordPress Support | Web Applications.

Formally trained in liberal arts and education (I have a B.A. in Government from Harvard and studied Secondary Education at Rutgers Graduate School), I have honed my skills in the communication arts and sciences as a teacher, trainer, instructional designer, writer, photographer, calligrapher, helpdesk manager, database programmer, and multimedia developer.

(I've also been a group counselor, waiter, bartender, bicycle messenger boy, computer salesman, carpenter's helper, financial analyst, and school board president.)

Tech

Systems since 1983.
Web sites since 1994.
PHP since 2001.
WordPress since 2007.

Contact

Book Meeting
770-772-5134
Email Jeff
Send Money
All Ways

Copyright 2026, nSiteful Web Builders, Inc.

Cookies Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
https://iframe.mediadelivery.net/embed/392008/42d18bc1-2adc-4741-b733-053d08d09c32
https://vz-000c5976-3ab.b-cdn.net/42d18bc1-2adc-4741-b733-053d08d09c32/play_720p.mp4

Receive occasional emails from Jeff