New [haspaid] Shortcode: Show Content to Paying (or not paying) Members Only

Jason just coded up a new shortcode feature for a support customer and we wanted to share it—hooray open source! It’s a little tricky to explain, but once you wrap your brain around the features, you’ll begin to think of interesting ways to apply it to your membership site.

The shortcode is primarily useful for sites that offer free trials and want to show (or hide) content to users who are on the trial vs. those that are full paying members.

has paid Shortcode for Paid Memberships Pro WordPress Plugin

A little more detail…

The “haspaid” shortcode detailed below looks up a member’s order history and checks whether their current level or any past levels have a positive order total value. Then, using the shortcode attributes, you can show or hide content only to members that match your criteria.

For example, the image above shows an upgrade message to members on a free trial of level ID 1 that have NEVER paid for the level. This is the shortcode and content used to create that callout.

If you’re using the Memberlite Theme, you can use the [memberlite_btn] shortcode like this:

[memberlite_btn style="action" href="/membership-checkout/?level=1" text="Upgrade to Gold Membership" icon="heart"]

Members of level ID 1 that are paying (full members) will not see this callout or any interruption in the standard content of your page/post.

Another example may be to wrap the [haspaid] shortcode inside of the [membership] shortcode to show an upgrade notice to members who USED to be a higher tier and are now a lower tier. For example:

Shortcode Attributes

  • paid: Accepts ‘true’ (has paid) or ‘false’ (hasn’t paid); default: true
  • level: The level ID to check against. Accepts any level ID; default: none.

Shortcode Examples

This will show up if the user has paid for any level.
[haspaid paid='0']
This will show up if the user has NOT paid for any level.
[haspaid paid='1' level='1']
This will show up if the user has paid for level 1 specifically.
[haspaid paid='0' level='1']
This will show up if the user has not paid for level 1 specifically.

The Code Recipe

This code recipe requires a PMPro Plus Account or higher.

View Membership Options