Shortcodes Reference
Shortcodes Reference
Section titled “Shortcodes Reference”All shortcodes require the viewer to be logged in. Logged-out visitors see a “Please log in” message or an empty string, as noted per shortcode. All shortcodes respect the Display & Appearance settings unless you override them with attributes.
Add shortcodes using the WordPress block editor’s Shortcode block, or paste them into classic editor content.
[bp_friend_suggestions]
Section titled “[bp_friend_suggestions]”Displays a grid or list of suggested friends for the logged-in member, filtered to exclude members already connected as friends.
Attributes:
| Attribute | Default | Description |
|---|---|---|
limit |
5 | Number of suggestions to show |
layout |
from Display settings | cards, list, or grid |
Examples:
[bp_friend_suggestions][bp_friend_suggestions limit="10"][bp_friend_suggestions limit="5" layout="list"]Logged-out behavior: Returns “Please log in to see friend suggestions.”
[bp_follow_suggestions]
Section titled “[bp_follow_suggestions]”Displays suggested members to follow. This shortcode filters out members the viewer already follows. On BuddyPress installs without the BP Follow plugin, the candidate pool falls back to the same set as [bp_friend_suggestions].
Attributes:
| Attribute | Default | Description |
|---|---|---|
limit |
5 | Number of suggestions to show |
layout |
from Display settings | cards, list, or grid |
Examples:
[bp_follow_suggestions limit="8"][bp_follow_suggestions layout="cards"]Logged-out behavior: Returns “Please log in to see follow suggestions.”
[bp_top_matches]
Section titled “[bp_top_matches]”Displays the member’s highest-compatibility matches sorted by percentage descending. Unlike [bp_friend_suggestions], no relationship filter is applied — all scored members are eligible, including existing friends.
Attributes:
| Attribute | Default | Description |
|---|---|---|
limit |
10 | Number of top matches to show |
layout |
from Display settings | cards, list, or grid |
Examples:
[bp_top_matches][bp_top_matches limit="20" layout="grid"]Logged-out behavior: Returns “Please log in to see your top matches.”
[bp_match_percentage]
Section titled “[bp_match_percentage]”Outputs the compatibility percentage between the logged-in member and a specific member.
Attributes:
| Attribute | Required | Description |
|---|---|---|
user_id |
Yes | The WordPress user ID of the member to compare against |
Example:
[bp_match_percentage user_id="123"]Output:
<span class="bffs-match-score">87%</span>Logged-out behavior: Returns an empty string.
Use this on individual member profile pages to show “You are 87% compatible” style messaging.
[bp_common_interests]
Section titled “[bp_common_interests]”Shows which xProfile field values the logged-in member and the target member share. Only renders if “Show Common Interests” is enabled in UX settings.
Attributes:
| Attribute | Required | Description |
|---|---|---|
user_id |
Yes | WordPress user ID of the member to compare |
Example:
[bp_common_interests user_id="123"]Output:
<div class="bffs-common-interests"> <h4>Common Interests</h4> <ul> <li><strong>Hobbies:</strong> Photography, Hiking</li> <li><strong>Music Genres:</strong> Rock, Jazz</li> </ul></div>Logged-out behavior: Returns an empty string.
[bp_mutual_friends]
Section titled “[bp_mutual_friends]”Lists the friends that both the logged-in member and the target member have in common. Requires the BuddyPress Friends component to be active; returns empty otherwise.
Attributes:
| Attribute | Default | Description |
|---|---|---|
user_id |
— (required) | WordPress user ID of the member to compare |
limit |
5 | Maximum number of mutual friends to display |
Example:
[bp_mutual_friends user_id="123" limit="10"]Logged-out behavior: Returns an empty string.
[bp_suggestions_count]
Section titled “[bp_suggestions_count]”Outputs the number of available suggestions for the logged-in member, as a number. Useful for notification badges or “You have X new suggestions” messages.
Attributes:
| Attribute | Default | Description |
|---|---|---|
threshold |
0 | Only count suggestions at or above this match percentage |
Examples:
You have [bp_suggestions_count] new suggestions!You have [bp_suggestions_count threshold="75"] high-compatibility matches!Output (logged-in):
<span class="bffs-suggestions-count">12</span>Logged-out behavior: Returns the bare string 0 (no HTML wrapper).
[bp_match_breakdown]
Section titled “[bp_match_breakdown]”Shows a field-by-field table of how the match score between the logged-in member and the target member was calculated.
Attributes:
| Attribute | Required | Description |
|---|---|---|
user_id |
Yes | WordPress user ID of the member to compare |
Example:
[bp_match_breakdown user_id="123"]Output: An HTML table with columns for field name, the logged-in member’s value, the target member’s value, the field’s weight, and whether the values matched.
CSS classes: .match-yes on matching rows, .match-no on non-matching rows.
Logged-out behavior: Returns an empty string.
Styling shortcode output
Section titled “Styling shortcode output”All shortcode output uses prefixed CSS classes you can target from your theme or a custom CSS file:
.bffs-suggestions-container { } /* outer wrapper */.bffs-card { } /* individual card */.bffs-card-avatar { } /* avatar container */.bffs-match-score { } /* percentage text */.bffs-dismiss { } /* X button on cards */
/* Layout variants */.bffs-layout-cards { }.bffs-layout-list { }.bffs-layout-grid { }CSS custom properties control colors:
:root { --bffs-primary-color: #007AFF; --bffs-success-color: #34C759; --bffs-text-color: #1d1d1f; --bffs-per-row: 3; --bffs-avatar-size: 100px;}Common patterns
Section titled “Common patterns”Dashboard widget area:
[bp_top_matches limit="5" layout="cards"]Profile comparison page:
Match Score: [bp_match_percentage user_id="123"][bp_common_interests user_id="123"][bp_mutual_friends user_id="123" limit="10"][bp_match_breakdown user_id="123"]Notification badge in a menu or header:
[bp_suggestions_count threshold="60"]Troubleshooting
Section titled “Troubleshooting”Shortcode shows nothing:
- The viewer must be logged in.
- Check that Enable Profile Matching is on (General settings).
- Verify that xProfile fields are configured for matching and that the viewer has values in those fields.
Match percentage shows 0%:
- No configured fields have matching values between the two members.
- One or both members have not filled in the relevant profile fields.
Layout attribute not working:
- Confirm you are using one of
cards,list, orgrid(lowercase). - Check that your theme is not overriding
.bffs-*CSS classes.

