Manual Processing - Backfill Existing Members
The auto-friendship rules fire automatically on new signups and role/type changes. Manual processing is the one-time sweep that retroactively connects every existing member to the ambassador pool you have configured.
Use it right after installing the plugin on an established site, after a bulk role import, or any time you have changed which roles or member types act as ambassadors.

When to run it
Section titled “When to run it”- Right after activation on a site that already has members.
- After a CSV import that bulk-assigned roles or member types.
- After adding or removing a role from the Auto-Friendship tab and wanting existing members to catch up.
You usually only need to do this once per rule change. Dynamic processing handles future signups and role changes automatically from then on.
Run a manual sweep
Section titled “Run a manual sweep”- Go to WB Plugins → Auto Friends → Overview.
- Click Welcome existing members now. The button appears under whichever mode you configured (roles or member types).
- A live progress bar appears showing total users, processed count, and friendships created.
The job runs in the background via WordPress cron. You can safely navigate away - processing continues. Return to the Overview tab to check the updated progress and final count.
What happens under the hood
Section titled “What happens under the hood”- The job runs
bautof_create_existing_friendships()via thebautof_create_existing_user_friendships_eventcron. - The initiator pool is every active member on the site. The ambassador pool is every member holding one of the configured roles or member types, plus any hand-picked Global Friends.
- Every initiator is friended with every ambassador, the same one-way, role-agnostic model new signups go through.
- Members are processed in batches of 100 users (configurable via the
bautof_friendship_batch_sizefilter) with memory checks at 85% of the PHP memory limit. - Each pair is created via
bautof_force_friendship()and the per-pair_bautof_auto_created_friendsmeta is set on both sides so cleanup can later identify these as plugin-created. - Friendship notification hooks are removed before the sweep and restored after it.
Concurrency safety
Section titled “Concurrency safety”| Transient | TTL | What it guards |
|---|---|---|
bautof_sync_running |
30 min | Prevents concurrent syncs |
bautof_sync_start_time |
2 hr | Tracks when the run started so a stuck job can be cleaned up |
If a sync gets stuck, use the emergency stop described in Troubleshooting Common Issues.
Large sites
Section titled “Large sites”On installs with many thousands of members, the sweep can run for several minutes. Leave the page open - the progress polling does not re-issue the job. If you close the tab, the cron keeps running in the background; return to the Overview tab later to see updated counts.
For installs with 50,000+ members, run the sweep during a quiet hour. Friendship notification emails are always suppressed for plugin-created friendships.

