Are you running a super private and exclusive membership site? In this tutorial, we show you how to define a specific list of “allowed” user email address or usernames for your membership levels.
With this code in place, users must enter one of the ‘allowed’ email addresses or usernames at checkout to complete registration. The code passes the entered user’s information through the pmpro_registration_checks filter. If the email address or username is blocked, the user sees a notice that they cannot register (this code works for both free and paid levels).
Note: this code snippet replaces the email or username restrict functionality from the Register Helper Add On (deprecated). You must be using PMPro 2.9+ and have the Register Helper Add On deactivated.
The Code Recipe
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.
After the recipe is in place on your site, navigate to Memberships > Settings > Levels and select a level to edit.
More Ways to Restrict User Registrations
Check out these additional tutorials with more ways to restrict user registration:
- Restrict Certain Words in Usernames
- Exclude Certain Email Domains from Membership Signup
- Limit the Number of Members by Membership Level
- Offer a Membership Level for a Limited Time
- Restrict Checkout for Users with a History of Refunds
- Restrict Membership Signup by Country
- Restrict Membership Signup by Email Domain
- Require a Discount Code to Checkout for a Certain Level
- Restrict Membership Checkout by Email or Username