The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · PHP

Display Total BuddyBoss Groups

Shared by Utsav Tilava · August 22, 2026

54 views
1 upvote
Back to Snippets

This shortcode displays the total number of groups available across the BuddyBoss site. BuddyBoss’s groups_get_total_group_count() returns the site’s total group count.

<?php
function display_total_buddyboss_groups() {

    if ( ! function_exists( 'groups_get_total_group_count' ) ) {
        return '';
    }

    $count = groups_get_total_group_count();

    return '<div class="bb-total-groups">
        <strong>Total Groups:</strong> ' . absint( $count ) . '
    </div>';
}

add_shortcode( 'bb_total_groups', 'display_total_buddyboss_groups' );
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments

Proudly supported by