Skip to content

Members directory view-count badge

New in 1.5.0

When Display → Show view count on members directory cards is on, each member card on the BuddyPress members directory page shows a small “N views” badge under the member’s name. The badge is public — every visitor (logged in or out) sees it.

Members directory with view-count badges

  • Below the member’s name and “Last active” timestamp, a tiny pill: “eye icon N views”.
  • The badge renders on every member card, including members with zero recorded views (they show “0 views”).
  • The number is computed from the same view-count column as the Members Views leaderboard, so the values stay in sync.

The badge renders inside the BuddyPress members-loop hooks:

  • bp_directory_members_item — the legacy per-card hook.
  • bp_directory_members_item_meta — the hook BP Nouveau’s real (AJAX-rendered) members loop fires per card. Added in 1.5.3 so the badge appears on live Nouveau directories (BuddyX, Reign, etc.).

The renderer dedupes per member, so wiring both hooks never produces a duplicate badge. If your theme heavily customises member cards, check that your members/members-loop.php still fires one of these actions.

  • 1.5.0 — the setting existed in earlier versions but no code read it; the rewrite wired it to a renderer so the badge shows when enabled.
  • 1.5.3 — fixed the badge not appearing on BP Nouveau directories (BuddyX, Reign, and other JS/AJAX-rendered member loops) by also hooking bp_directory_members_item_meta.

In WB Plugins → Profile Views → Display:

  • Show view count on members directory cards — toggle the badge on/off.
  • Avatar size (px) — also controls badge icon sizing in some themes.

See Display tab for the full panel.

The number on the badge respects the General → Exclude logged-out viewers setting. If excluding is on (the default), the count reflects only logged-in visitors — so anonymous traffic and crawler hits don’t inflate it.

The badge query runs once per directory render. The members-directory page is paginated by BuddyPress (default 20 cards per page), so the cost is bounded. On installs with millions of view rows, a covering index of (user_id) is already shipped — see Database schema.