We have several tutorials for altering the membership levels page using the default shortcode or the Advanced Levels Page Add On. This post summarizes several methods to:
- Alter the display order
- Dynamically display levels based on the current user’s level
- Hide levels from display (without blocking registration)
- Bypass the levels page entirely
It’s a useful guide if you aren’t quite sure of a method to use and want to explore your options.
Table of contents
- Reordering the Membership Levels Display
- Dynamically Display Certain Levels Based on the Current User’s Active Level
- Hide Free Levels from the Membership Levels Display
- Hiding Specific Levels (by ID) from the Membership Levels Display
- Skipping the Membership Levels Page
- Skipping the Membership Checkout Process
Reordering the Membership Levels Display
Navigate to the Memberships > Membership Levels page in the WordPress Admin. Here you can drag and drop the membership levels into the order you would like them to display when using the default shortcode or the Advanced Levels Page Add On.
If you are using the [pmpro_advanced_levels]
shortcode, you can also specify the levels="2,4,1"
attribute to force the display in your preferred order. This method will simultaneously reorder the display AND filter out levels you do not want to display.
Dynamically Display Certain Levels Based on the Current User’s Active Level
Some sites would like to customize which levels are offered based on the current logged-in member’s active membership level. There are two methods to dynamically alter the display of the membership levels page: using the membership shortcode or using the pmpro_levels_array filter.
Using the Membership Shortcode
If you need to show specific level options, you can combine the two shortcodes as follows:
Code Snippet: Using the Membership Shortcode to Hide or Show Levels
In this example, members of level 1 will see details for levels 2, 3, or 4 while members of level 2 will see details for levels 5, 6, or 7. The last portion of the sample above will show the option to check out for either level 1 or 2 for any non-member (level=”0″).
Note that if you truly need to restrict check out based on existing level requirements, check out this blog post with a deeper tutorial on membership requirements for checkout.
Using the pmpro_levels_array
Filter
The recipe below demonstrates how to use custom code to filter the output of the default levels page using the pmpro_levels_array filter.
Code Snippet: Using the pmpro_levels_array Filter to Hide or Show Levels
You’ll need a working knowledge of PHP in order to customize this example for your specific needs. Support level members can open a ticket in our support area for help with this function.
Hide Free Levels from the Membership Levels Display
Here’s a tutorial for hiding all the free levels from display. This is a useful method if you have free levels that are reserved for specific customers or promotions, etc.
Hiding Specific Levels (by ID) from the Membership Levels Display
To hide levels using the [pmpro_advanced_levels]
shortcode, just exclude them from thelevels="1,2,3"
attribute of the shortcode. Easy!
If you are using the default levels page shortcode, you have two options for hiding levels from the output:
Option 1: Define hidden levels in a custom function.
The code recipe below allows you to define specific level IDs that will not be shown on your membership levels page.
Code Recipe: Define hidden levels in a custom function.
Update line 17 with a comma-separated list of level IDs to hide.
You can then modify the list items to add the appropriate links for your membership site.
Option 2: Add a setting to “hide” levels from display on the Memberships > Edit Level admin.
This code recipe adds a new level setting to hide the display. If you expect to be manipulating level display fairly often and would prefer to do so via settings in the dashboard vs. code, this is the recipe for you. After installing the customization code, just navigate to Memberships > Edit Level and set “Show level” to “Yes” or “No”.
Code Recipe: Add a setting to “hide” levels from display.
You can then modify the list items to add the appropriate links for your membership site.
Skipping the Membership Levels Page
If you have only one public level of membership, this method will redirect members from the membership levels page directly to membership checkout for the defined PMPRO_DEFAULT_LEVEL
.
Skipping the Membership Checkout Process
As with the “skipping” option above, this method will allow you to use the default WordPress registration process (or another plugin or theme’s registration process) and apply a default level of membership.
DOWNLOAD NOW
Grab the free cheat sheet and exercises for help designing your membership site brand guide, website graphics, and pricing page. This guide will help you create a cohesive look and feel that tells your membership’s story across everything you publish.
Free Course: Membership Site Development—The Basics
Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.