Unique Membership Numbers: Generating and Displaying (2024)

Give your members their own 10-digit membership number, different from the “User ID” they automatically get when signing up on your site. This approach is particularly beneficial for associations, clubs, fitness websites, and more.

Having a unique membership number is great for keeping things private and secure, since it separates a member’s public identity from the behind-the-scenes database stuff. Plus, it makes managing memberships a breeze when you need to link up with other systems for things like in-person membership validation, event sign-ups, and special member perks.

In this guide, we’ll show you how to set up these unique numbers when members register. Then, we’ll cover various ways you can display the member’s number in different parts of your site’s frontend and admin area.

Unique Membership Numbers: Generating and Displaying (1)

Table of contents

  • Generating the Member Number: Custom Function
  • Displaying on Member Account Page
  • Show Member Number on Member Invoice
  • Displaying on Confirmation Email
  • Show Member Number on Members List and Members CSV Export
  • Displaying the Membership Number on the Member Directory and Profile Pages
  • Displaying the Membership Number on the Membership Card
  • Using a Shortcode to Display the Member Number

Generating the Member Number: Custom Function

With Paid Memberships Pro’s customizability, it’s pretty simply to generate a member number and then display it on the frontend of your site. Plus, this same member number can be used in the backend or admin area, giving site owners and administrators new ways to reference each member.

Below is the primary recipe that creates a unique membership number. With this recipe in place, all members will have their number generated afercheckout.

Then, we continue the guide with various places to display that number: on the Members List, in the Confirmation Email, Membership Account or Invoice pages, on a Membership Card and even for other members to see as part of a public or members-only Directory and Profile Page.

If you’re building a custom recipe or template and want to access the member number in PHP, you can do so by using the WordPress get_user_meta function. The generated number is stored in user meta with the key member_number.

Generate a 10-digit member number

Displaying on Member Account Page

You can use the recipe below to display each member’s unique 10-digit number on their account page. This gives them quick access to their identifier for memberships benefits and inquiries.

Member Number on Member Account Page

Unique Membership Numbers: Generating and Displaying (2)

Show Member Number on Member Invoice

Including the unique 10-digit membership number on member invoices enhances clarity and record-keeping. This code recipe allows members to easily reference their membership details for payments and queries.

Display on Member Invoice

Unique Membership Numbers: Generating and Displaying (3)

Displaying on Confirmation Email

Adding the unique 10-digit membership number in the confirmation email provides members with an immediate and personal acknowledgment of their registration.

Member Number on Checkout Confirmation Email

Unique Membership Numbers: Generating and Displaying (4)

Show Member Number on Members List and Members CSV Export

To display the unique member number to admin, this code recipe will add “Member Number” as a column on the Members List. The number will be located at Memberships > Members in the WordPress admin.

A member’s number is also then included in a CSV export of your Members List from this same screen.

Display Member Number on Members List and CSV Export

Unique Membership Numbers: Generating and Displaying (5)

Displaying the Membership Number on the Member Directory and Profile Pages

The Member Directory and Profile Pages Add On has built-in functionality to retrieve information stored in the wp_usermeta table. Follow the steps below using the meta key member_number.

Steps to Display the Membership Number

  1. Install, activate and set up the Member Directory and Profile Pages Add On.
  2. Edit your site’s Membership Directory or Profile Page. You can locate these assigned pages from the Memberships > Settings > Pages screen in the WordPress admin.
  3. Edit the page and use the fields attribute to add the Member Number to your directory or profile.
Unique Membership Numbers: Generating and Displaying (6)

Example of the Membership Directory shortcode

[pmpro_member_directory fields="Member Number,member_number"]

Example of the Membership Profile shortcode

[pmpro_member_profile fields="Member Number,member_number"]

Displaying the Membership Number on the Membership Card

You might find yourself wanting to display the unique membership number on membership cards for identification. This code recipe places it on the membership card and automatically creates a membership number if the user does not already have one.

Display Member Number on Membership Card

Unique Membership Numbers: Generating and Displaying (7)

Using a Shortcode to Display the Member Number

Insert the Member Number in another location on your site, the following shortcode will output the number for a logged in user.

[pmpro_member field="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.

If you need support generating membership numbers for existing users or customizing to only generate and display membership numbers for a specific level, reach out to our support team.

Unique Membership Numbers: Generating and Displaying (8)

Author: Jarryd Long

Jarryd is a Technical Support Engineer at PMPro. He prides himself on offering the best support to our customers and has been a part of the WordPress space since his high school days. He's developed a variety of plugins as well as spoken on the topic of providing outstanding support to customers.

View more articles by Jarryd Long »

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.

Take Free Course Now

Was this article helpful?

YesNo

Unique Membership Numbers: Generating and Displaying (2024)
Top Articles
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 5734

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.