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.
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’)

Comments (9)
Hi, what’s the exact shortcode name pls?
Sorry found it [pmpro_member_count]
“defining attribute” justmember means [pmpro_member_count justmember=true]
level as a comma delimited list doesn’t work. I tried
[pmpro_member_count level=1,2,3,5] and
[pmpro_member_count level=”1,2,3,5″]
I was going to add this to the plugin/gist for you, but it gets complicated generating the text “This site has %s members”. If you wanted to update yours to do this, you could do something like:
$levels = array_map(‘trim’, explode(‘,’, $attrs[‘level’]));
And then update
AND `membership_id` = ” . intval($attrs[‘level’]);
to be
AND `membership_id` IN(” . $levels . “)”;
Hi, Could this be used to count members who have bought access to a single page using the “Purchase Access to a Single Page or Post” Add On?
The SQL would have to be changed to count the data we store in post meta and user meta. If you post to our member forums and mention that I sent you, we can work on that for you.
On a page, I tried something like: currently we are [pmpro_member_count justmember=true] in total
It didn’t work; somebody help!
Hi there,
Thanks for reaching out to us. If you open up a support topic on our Members Support Forums then one of our support engineers could take a closer look into this for you.
Hope this helps!