Paid Memberships Pro includes a few no-code and code based ways to show a member’s expiration date. This guide explains where the member’s expiration date is shown by default and some places you might want to add this info.

Banner for Advanced Code Recipe Tutorial for Paid Memberships Pro

Where the Expiration Date is Shown

It’s very important that your members always have a clear picture of their membership status. In Paid Memberships Pro, we automatically show the member’s expiration date in a few key locations:

  • If a membership level has an expiration date, we show it on their Membership Account page. This is the main page where members can access and review their account details at any time.
  • When members check out for a fixed-term membership, the expiration date is included in the Membership Confirmation page and email. That email is sent to members right after checkout. This helps keep members informed right from the start and serves as a handy reference for their membership duration.
  • If a member decides to cancel a recurring membership, the expiration date is automatically set to their next payment date. We show this updated expiration date on the confirmation screen of Membership Cancel page as well as in the Membership Cancel emails sent to users and admins. This helps members understand exactly when their access ends, so they can make the most of their membership until expiration.

Method 1: The [pmpro_member] Shortcode

The [pmpro_member] shortcode is a built in way that your Paid Memberships Pro-powered site can personalize in-page content with the logged in member’s information.

One of the most common things people want to add is a reminder of a member’s upcoming expiration date. We’ve seen sites adds this to a custom popover or sitewide banner, and also within an account-related widget.

Use the [pmpro_member field="membership_enddate"] shortcode in a page, post, widget, or pretty much anywhere on your site. The shortcode shows the current logged in member’s expiration date or the expiration date. The date is formatted per your site’s Settings > General > Date Format field. If there is no expiration for user, the shortcode displays nothing.

Note: This method works best when your site only allows members to hold one level at a time. In PMPro v3.0 and higher, members can now hold multiple levels simultaneously.

The shortcode only returns the expiration date for the member’s most recently added level, which may or may not be the data you want to show.

How to Use the Shortcode

The shortcode [pmpro_member field="membership_enddate"] can be used anywhere you would like to display the date. If you would like to add it to a widget area but it isn’t working, add this line of code to a helper PMPro Customizations plugin

// Enable the use of shortcodes in text widgets.
add_filter( 'widget_text', 'do_shortcode' );

Method 2: Show Membership Expiration Date Using Custom Code

Another way to leverage the [pmpro_member] shortcode is to load it via custom code. In this example, we hook into the bbPress Profile page to display the member’s expiration date. This recipe relies on our bbPress Add On setting to add the “Membership Level” section to the bbPress Profile.

Again, as with the previous shortcode method, this works best in the context of a site where members only hold one level at a time.

The Code Recipe: Load pmpro_member Shortcode on bbPress Profile

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.

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?