Use the following code recipe to display a “Renew” link on the Membership Account page at your desired period before a member’s expiration date.

Banner Image for Choose when to Display the Renew Link to Members who Sign Up for a Membership Level with an Expiration Date

About the Code Recipe

By default, when a member signs up for a membership level that has an expiration date, they will see a “Renew” link a certain number of days prior to their membership expiration date. When a member “Renews” their membership, the new period is automatically tacked on to the end of their existing membership level. The core plugin has built-in logic to determine when the “Renew” link appears based on the active member’s billing and expiration date settings.

If the member logs in to their membership account before this timeframe is triggered, they will instead see a “Change” link, allowing them to view current membership level offerings and change their membership level. This code recipe allows you to control exactly when the “Renew” link will appear for the member.

Example Logic of When Renew Buttons Show for Expiring Memberships

The following table assumes each level is set up to expire in 1 hour, 1 day, 1 week, etc. Use this chart to understand when the default renew button will appear without any additional custom code needed.

Level TypeExpiration PeriodRenew Button Visibility Condition
Hourlyly1 hourButton will show if the level is expiring within 1 hour.
Daily1 dayButton will show if the level is expiring within 1 day.
Weekly7 daysButton will show if the level is expiring within 7 days.
Monthly30 daysButton will show if the level is expiring within 30 days.
Yearly365 daysButton will show if the level is expiring within 365 days.

The Code Recipe

More about Renewals and PMPro

If you are new to PMPro, check out some of these other articles related to member renewals:

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