Some sites need to offer a specific enrollment period, perhaps for a specific session of a class or other training event.
This recipe allows you to set a specific window of time for membership registration. Users will not be able to checkout for the level after your specified cutoff date.
Understanding the pmpro_registration_checks filter
The pmpro_registration_checks filter hook in Paid Memberships Pro allows you to customize the default registration validation logic, determining whether a user is allowed to complete registration for a membership.
Functions hooked to this filter can return true to allow registration to proceed, or false to prevent it.
About the Code Recipe
This code recipe uses the pmpro_registration_checks filter to add a validation step during checkout that checks whether the membership registration cutoff date has already passed.
If the cutoff date has passed:
- Registration will be blocked.
- A message is shown to the user informing them that registration has ended.
- The membership level’s settings are updated to disallow future signups.
- The level is removed from display on the “Membership Levels” page.
Existing members of the level will retain access for the duration of their membership term.
To reopen registration later, remove this code recipe from your site and uncheck “Disable New Signups” on the Memberships > Settings > Levels > Edit admin dashboard page.

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.
How to Customize This Recipe
Update line 18 with the ID of your limited time membership level and line 19 with the date the membership stops being offered (in YYYY/MM/DD format).
You can find your level’s ID on the Memberships > Settings > Levels screen in the WordPress admin dashboard.
Video: Coding with Sam Walkthrough
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


