The Membership Card Add On allows you to create a printable, customizable Membership Card for Paid Memberships Pro members or WordPress users. This article will cover five approaches to customizing the appearance and content of the card. It includes adding additional content such as an avatar, showing custom User Metadata, displaying a member number, doing a complete overhaul to the template or check if a member has the required subscription level.

Methods to Customize Membership Cards for WP Users and PMPro Members

Method 1: Adding Additional Content to Your Membership Card

Appending additional information below the primary content on the card can be done using the pmpro_membership_card_after_card action hook. For example, the recipe below will show you how to add the user’s avatar to the card display.

This code recipe requires a premium membership plan.

View Pricing

Method 2: Displaying Custom Fields on Your Membership Card

Many sites that are capturing custom user profile fields using User Fields or custom code also want to show this profile data on the Membership Card.

The recipe below will demonstrate how to capture a new User Metadata called “Graduation Year” and then display it on the Membership Card.

This code recipe requires a premium membership plan.

View Pricing

Method 3: Displaying the Member Number on Your Membership Card

You may have also set up member numbers for your members and would like to display these details on your membership card. The recipe below retrieves the member’s “member number” and displays it on the membership card: 

This code recipe requires a premium membership plan.

View Pricing

Method 4: Create a Custom Template for Your Membership Card

An alternative option would be to override the membership card template that is included in the Membership Card Add On and use your own. This can be done by either creating a file named membership-card.php in your theme or by loading the custom template in a customizations plugin.

First, create a blank file called membership-card.php in the main folder of your customizations plugin. Then, use the recipe below to load your custom template (in place of the template included in the Add On).

This code recipe requires a premium membership plan.

View Pricing

Once the above code is in place, open the file located at /wp-content/plugins/pmpro-membership-card/templates/membership-card.php. Copy and paste the contents of that file into your newly created membership-card.php file.

From here you can begin editing the output of the Membership Card for your needs.


Method 5: Changing the Return Value of Your QR Code

The default return value upon scanning a membership card will provide you with a member’s user ID.

The recipe below will allow you to check if a member has the required subscription level. If they do, the QR code data will return ‘active’. If not, it will return ‘inactive’. 

You can change line 23 in the below recipe to meet your requirements depending on what a member’s account should or shouldn’t have. 

You’ll need to add the attributes qr_code="true" and qr_data="other" to your membership card shortcode in order for this to work as expected.

To extend and customize the user and membership data that is displayed when the QR code is scanned, check out this code recipe.


Another option to generate a unique member number:

We have previously published a way that will allow you to generate a unique member number. This is specifically to display on the membership account, the confirmation email and more.

View guideline on how to generate a unique member number.

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?
YesNo