This nifty little shortcode will output the number of members in a level (or across all levels).

The output displays a message in the format: “This site has 25 Gold members”, or you can define the attribute ‘justnumber’ to output only the count of members and craft your own message like the one pictured to the right.

Banner for Advanced Code Recipe Tutorial for Paid Memberships Pro

Shortcode Attributes

  • justnumber: Show just the count of members (optional; default: NULL)
  • level: A single level ID or comma-separated list of level IDs (optional; default: count for all levels)
  • status: A single status or comma-separated list of statuses (optional; default: ‘active’)
Screenshot of shortcode rendering number of members

The Shortcode Plugin

Copy and paste this code into a standalone .php file and upload to your site’s ‘wp-content/plugins’ folder. Activate the plugin via the Plugins admin page.

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