Friend & Follow Suggestions Block
Friend & Follow Suggestions Block
Section titled “Friend & Follow Suggestions Block”The plugin registers one Gutenberg block: Friend & Follow Suggestions (bffs/suggestions). It appears in the block inserter under the BuddyPress category and produces the same output as the equivalent shortcode, making it the preferred way to add suggestion lists to pages you edit with the WordPress block editor.
Adding the block
Section titled “Adding the block”- Open a page or post in the block editor.
- Click the “+” inserter or type
/in an empty block. - Search for “suggestions” or scroll to the BuddyPress category.
- Click Friend & Follow Suggestions to insert the block.
You will see a live preview of the suggestion cards in the editor canvas (using WordPress ServerSideRender). If the preview shows the “please log in” copy it is because the editor preview runs in a reduced authentication context; the block renders correctly for logged-in visitors on the front end.
Block settings
Section titled “Block settings”Open the block sidebar panel (Block tab on the right) after inserting the block.
Context
Section titled “Context”Controls which candidate pool the block queries.
| Value | Candidates shown |
|---|---|
| Friends (default) | Members not yet connected as friends |
| Follow | Members the viewer does not already follow (requires BuddyPress Follow or BuddyBoss follow) |
| All | All compatible members; no relationship filter (equivalent to [bp_top_matches]) |
On sites without a follow component active, choosing “Follow” falls back to the same pool as “Friends”.
The maximum number of member cards to display. Accepts 1-50. Default is 5.
Layout
Section titled “Layout”Overrides the site-wide layout set in Settings > Display & Appearance. When left blank the block inherits the admin setting.
| Value | Description |
|---|---|
| (blank) | Inherit from Display settings |
cards |
Responsive multi-column card grid |
list |
Single-column vertical list |
grid |
Fixed-column grid |
Alignment
Section titled “Alignment”The block supports Wide and Full width alignment when the active theme declares wide-width support.
How the block renders
Section titled “How the block renders”The block uses server-side rendering: each page request runs PHP to build the HTML, so suggestion lists are always up to date without any JavaScript hydration step. Internally it calls the shortcode handler from BFFS_Display, so what you see in the block is byte-for-byte identical to what [bp_friend_suggestions], [bp_follow_suggestions], or [bp_top_matches] would produce on the same page.
Attribute mapping:
| Block attribute | Equivalent shortcode |
|---|---|
context: friends |
[bp_friend_suggestions] |
context: follow |
[bp_follow_suggestions] |
context: all |
[bp_top_matches] |
limit: N |
limit="N" |
layout: cards |
layout="cards" |
Respects the master toggle
Section titled “Respects the master toggle”The block checks the same “Enable Profile Match Scoring” toggle (Settings > General) that the shortcodes and widgets check. When that setting is off the block outputs nothing on the front end, and the editor preview shows the “please log in” copy rather than cards.
Theme template override
Section titled “Theme template override”If you need to customize the card HTML, create this file in your (child) theme:
{theme}/buddypress-friend-follow-suggestion/blocks/suggestions/render.phpThe plugin checks for a theme template first via locate_template() before falling back to its own templates/blocks/suggestions/render.php. The same $attributes array (with context, limit, and layout keys) is available inside the override template.
Troubleshooting
Section titled “Troubleshooting”Block preview shows “Please log in to see friend suggestions.” The editor ServerSideRender request runs without full session auth in some configurations. This is expected behavior in the editor; front-end output for logged-in visitors is correct.
Block renders nothing on the front end
- Confirm Settings > General > Enable Profile Match Scoring is on.
- Confirm at least one xProfile field is configured for matching.
- Confirm the visitor is logged in.
“Follow” context shows the same people as “Friends” The BuddyPress Follow component or BuddyBoss follow feature is not active. The pool falls back automatically.
Block does not appear in the inserter
- The plugin must be active.
- The WordPress block editor must be in use (the classic editor disables Gutenberg blocks).
- Confirm no JavaScript errors in the browser console on the editor page; missing script dependencies can prevent block registration.

