This code recipe adds a notification banner to remind members that their account will expire within 7 days—or any custom timeframe you would like. You can use the recipes with any WordPress theme, or specifically with a membership site using Memberlite.

Banner Image Add a Customized Notification Banner to Alert Your Members of Upcoming Expiration

About the Code Recipe

By default, Paid Memberships Pro will send members an expiration email notice 7 days prior to their expiration date. For more customization and extra expiration warnings, see our Extra Expiration Warning Emails Add On.

This recipe adds an expiration warning directly on your site, reminding the logged in member that they must renew to maintain access. The banner will only be shown to a member that has an active membership level with an expiration date within the next 7 days. You won’t need to rely on email delivery, receipt, or that your member will actually read the message.

Memberlite's notification banner when membership is expiring soon
Add a notification banner using Memberlite.

If a member decides to renew their membership by clicking the “Click here to renew membership” link, they will be redirected to the membership levels page. From here they can select their desired membership level and proceed to checkout. They will no longer see the message.

The Code Recipe: For Memberlite

The Code Recipe: For Any WordPress Theme

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.

Customizing the Recipe

You will need to adjust this code for your own site. For example, consider changing the background color of the banner by changing the “background-color” value found in the code to suit your brand colors.

You could also change the number of days from expiration that you would like the banner to appear by changing the number of  '- 7 days' value.

If you need help with tweaking this code, get in touch with our support team.

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