WP-CLI Commands
Control BuddyActivity from the command line for server automation, cron jobs, and scripting.
BuddyActivity includes a set of WP-CLI commands for server-side control. WP-CLI is especially useful for running syncs via server cron on a precise schedule, bypassing the limitations of WP-Cron on low-traffic sites.
Available Commands
| Command | Description |
|---|---|
wp buddyactivity sync | Run a full sync immediately — reads the sheet and processes all pending rows. |
wp buddyactivity sync --dry-run | Preview which rows would be processed without actually creating any activities. |
wp buddyactivity status | Display the current sync status — last run time, rows pending, rows processed. |
wp buddyactivity reset-position | Reset the sheet position pointer to row 2 (first data row). |
wp buddyactivity clear-logs | Delete all sync log entries from the database. |
wp buddyactivity clear-queue | Remove all completed jobs from the jobs queue. Does not affect pending or processing jobs. |
Running Sync via Server Cron
To run BuddyActivity sync every 15 minutes using a server-level cron job, add the following to your crontab (via crontab -e or your hosting control panel):
*/15 * * * * cd /var/www/html && wp buddyactivity sync --path=/var/www/html --quietReplace /var/www/html with the actual path to your WordPress installation.
--quiet suppresses output to keep cron emails clean. Remove it during testing to see the full output.Using --dry-run
The --dry-run flag lets you preview what a sync will do without making any changes. This is useful when:
- You have added a large batch of rows and want to verify everything looks correct before publishing.
- You are debugging a sync issue and want to see which rows would be processed.
- You want to confirm your sheet structure is valid before the first live sync.
wp buddyactivity sync --dry-runThe output will list each row that would be processed, its type, user, and scheduled time — without creating any BuddyBoss activities.