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.

Restrict Membership Checkout by Email or Username

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.

Screenshots

Screenshot of the Edit Membership level page with the Restrict by Email and Restrict by Username fields in Other Settings
Screenshot of the Edit Membership level page with the Restrict by Email and Restrict by Username fields in Other Settings

Restrict Email at Checkout - Screenshot of blocked membership checkout
Restrict Email at Checkout – Screenshot of blocked membership checkout

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.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo