Introductory Pricing: Save 50% on your first year of any plan. Use coupon code:

FIRSTYEAR50

  • Log In
  • Welcome
  • Features
  • Pricing
  • Documentation
  • Case Studies
  • Add Ons
  • Support
  • Learn
  • Events
  • Blog
  • Contact

Log In

Join Now | Lost Password?
Skip to content
Paid Memberships Pro WordPress Membership Plugin
  • Log In
  • Choose a Plan
  • Features
    • PMPro Platform
      • Plugin Features
      • Restrict Access
      • Register Members
      • Subscriptions
      • All Features
    • Payment Gateways
      • Stripe
      • PayPal Express
      • Paystack
      • CCBill
      • All Gateways
    • Add Ons
      • Integrations
      • Free Add Ons
      • Standard Add Ons
      • Plus Add Ons
      • All Add Ons

    Launch a Free Demo
    Explore PMPro in action with your own private demo site—preloaded with members, protected content, and premium Add Ons.

    Try PMPro Now
  • Use Cases
    • Associations
    • Blog and News
    • Communities
    • Courses
    • Directories
    • Paid Newsletters
    • Private Videos
    • Podcasting
  • Documentation
    • Download & Install
      • Download PMPro
      • Install Add Ons
      • Memberlite Theme
      • Setup WordPress
      • Staging Sites
      • Support
    • Initial Setup
      • Customize Pages
      • Payment Settings
      • Restrict Content
      • Membership Levels
      • Member Emails
      • User Fields
    • More Docs
      • Shortcodes & Blocks
      • Design Settings
      • Page Builders
      • Reporting
      • For Developers
      • All Docs

    Get your membership site up and running with Kim's help.

    Watch Initial Setup
  • Community
    • Engage & Learn
      • Upcoming Events
      • Courses
      • Videos
      • Step-by-Step Guides
      • Join Slack
      • Get Support
    • Blog
      • Case Studies
      • Product Comparison
      • Code Recipes
      • Release Notes
      • Migration Guides
      • All Blog Posts

    Join the Community
    Connect with other membership site creators who use PMPro to get paid.

    Join Slack
  • Pricing
Home  >  Blog  >  Generating and Displaying Unique Membership Numbers

Generating and Displaying Unique Membership Numbers

Estimated reading time: 5 minutes

TweetFacebookLinkedIn

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.

Banner Image for Code Recipe Generate a Unique Member Number for Display on Membership Account, Confirmation Email and More

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
Screenshot of member number showing on membership account page in Paid Memberships Pro

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
Screenshot of the member number displaying on the membership invoice page in Paid Memberships Pro

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
Screenshot of the member number displaying in the membership confirmation checkout email with Paid Memberships Pro

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
Screenshot of the member number showing on the members list in Paid Memberships Pro

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.
Screenshot of the member directory page displaying the unique member number in Paid Memberships Pro

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
Screenshot of the unique member number displaying on the membership card using the Member Card Add On for Paid Memberships Pro

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.

Jarryd Long

Author: Jarryd Long

Jarryd Long is the Support Manager at Paid Memberships Pro. With over 11 years of experience developing and supporting WordPress products, he has worked with a wide range of tools, from map and live chat plugins to podcasting and now membership software.

Jarryd enjoys working at Paid Memberships Pro for its supportive and positive team culture, where collaboration and mutual respect are key.

Outside of work, Jarryd is an old car enthusiast and is gradually restoring a Morris Oxford, a project that combines his love for classic vehicles and hands-on craftsmanship.

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
Featured Image for Membership Site Development Course: The Basics


Was this article helpful?
YesNo
Tagged: pmpro_account_bullets_bottom, pmpro_email_filter, pmpro_invoice_bullets_bottom. Posted in Code Recipes, Premium Code Recipes. Bookmark the permalink. Last updated: March 8, 2024.
Post navigation
← Members-Only Zoom Live Streams For Your Membership Site
How to Design a Combined Login and Registration Page for Your Membership Site →

Paid Memberships Pro is recommended by our customers and users

Plugin Reviews

4.3 out of 5

G2

4.8 out of 5

Capterra

5 out of 5

We’re 100% GPL

Our plugin's code is not obfuscated, runs on as many sites as you want and can be customized to fit your project's needs. We just ask that you follow the GPLv2 guidelines by applying the GPLv2 license to any altered or unaltered version of PMPro that you distribute. License Details »

GPL v2

Recent Articles and Updates

  • Featured image for code recipe 'Customize Login Error Messages to Boost Account Security'
    Customize Login Error Messages to Boost Account Security
  • Banner for Memberlite v6.0
    Introducing Memberlite v6.0
  • Screenshot of featured image for 'Capture User Fields for Google Analytics Integration Add On' code recipe post
    Capture User Fields as User Properties for Reporting in Google Analytics Integration Add On

Platform

  • Pricing
  • Features
  • Product Comparison
  • Reviews
  • Case Studies
  • Screenshots
  • Videos
  • Step-by-Step Guides

Use Cases

  • Associations
  • Blog & News
  • Community
  • Courses
  • Directory & Listing
  • Paid Newsletter
  • Podcast
  • Videos

Add Ons

  • Free
  • Standard
  • Plus
  • Admin
  • Integration
  • Payment
  • Third Party
  • View All

Get Help

  • Support
  • Documentation
  • Download & Install
  • Hosting
  • Developers
  • Blog
  • Slack Community
  • Contact Us

Company

  • About Us
  • Events
  • Brand Assets
  • Affiliates
  • Accessibility Statement
  • Sitemap
  • Privacy Policy
  • Terms of Service
Join Us On

© 2025 Paid Memberships Pro™. Paid Memberships Pro is a trademark of Stranger Studios, LLC. All Rights Reserved.

Open Office Hours: Ask Me Anything with Jason and Andrew • Thursday, May 15th at 11am ET. SEE DETAILS ▸