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.
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 Type | Expiration Period | Renew Button Visibility Condition |
---|---|---|
Hourlyly | 1 hour | Button will show if the level is expiring within 1 hour. |
Daily | 1 day | Button will show if the level is expiring within 1 day. |
Weekly | 7 days | Button will show if the level is expiring within 7 days. |
Monthly | 30 days | Button will show if the level is expiring within 30 days. |
Yearly | 365 days | Button 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:
- Reward members with a discount for renewing their membership early
- Offer Expired and “Old” Members a Membership Renewal Discount for Coming Back
- Change the Membership Account Renew link to a Renew button
- Add an Auto-Renewal checkbox to your checkout page.
- Allow members to Renew on the same date
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.