At first glance, restricting your members from renewing their membership might seem counterproductive. Membership sites thrive on recurring revenue. However, there are specific situations where you may need to restrict renewals for certain membership levels.

These code recipes prevents membership renewal for their current membership level. Instead, they will be prompted to select a different membership level at checkout. The recipes are customizable, allowing you to define which levels are restricted and to set a custom error message.

Banner Image for Prevent Membership Renewal Code Recipe

Why Use These Code Recipes?

Here are some practical reasons for preventing membership renewals:

  1. Trial Memberships: Create a one-time trial level that cannot be renewed.
  2. Encourage Upgrades or Downgrades: Prompt members to move to another level rather than staying in their current one.
  3. Grandfathering Members: Migrate members to a new level with updated pricing or benefits when their current membership ends.
  4. Level Phase-Outs: Close a membership level entirely and require members to select a different option.

A Closer Look at “Grandfathering In”

One common use case for these recipes is grandfathering members into a new membership level or pricing structure. For example, if you’re increasing the price of a membership level or phasing it out entirely, this recipe ensures current members complete their existing term but cannot renew under the old conditions.

With these code recipes, site administrators can now let their members live out the term of their membership and when it comes time to renew their subscription they will be prompted to choose a different membership level.

About the Code Recipes

When members try to renew a restricted membership level, they will see an error message that reads:

This is your current membership level. Please select a different membership level.

Error message show on Membership Checkout page

You can modify this message and specify which membership levels are affected. This method is best used for one or two levels, rather than applying it site-wide.

This approach differs from the Lock Membership Level Add On, which prevents members from making any changes to their membership. With this recipe, members can still select a new level when their current one expires.

Note: The membership level does need to be a set up to have members manually renew. This recipe will not work for membership levels with automatic recurring payments (subscriptions).

Code Recipe #1 – Preferred

This code recipe prevents specific membership level(s) from being renewed. Determine which membership level IDs you would like to include by navigating to Memberships > Settings > Levels.

Customization: Replace the membership level ID numbers within the $restricted_level array on line 33. You can also update the error message that is shown by editing line 38.

Code Recipe #2

This code recipe will apply to all levels site-wide.

Customization: You can update the error message that is shown by editing Line 35.

Video: Coding with Sam Walkthrough

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.

More Useful Articles

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