Skip to content

Clearing a WooCommerce Action Scheduler backlog on cPanel

How to diagnose and clear a WooCommerce Action Scheduler backlog on a cPanel-hosted site — what the queue contains, why it grows, and how to bring it back to current.

Action Scheduler is the background-task queue WooCommerce uses for emails, subscription renewals, status transitions, stock syncs, and dozens of other deferred actions. When the queue backs up, customers stop getting receipts, abandoned-cart emails fire days late, and subscription renewals don’t run on time. The queue itself is usually fine — what’s broken is the trigger that processes it.

What’s happening

Action Scheduler stores pending actions in wp_actionscheduler_actions. A processor (triggered by WP-Cron or system cron) picks up pending actions and runs them in batches. The default batch size and concurrency are conservative. Under heavy load, more actions get queued than processed, the queue grows, and over time it becomes a backlog. The trigger failing entirely (WP-Cron not firing) produces the same backlog faster.

How to verify

wp action-scheduler queue-list
wp action-scheduler list-actions --status=pending --per-page=10
wp db query "SELECT status, COUNT(*) FROM wp_actionscheduler_actions GROUP BY status"
crontab -l | grep wp-cron

Pending counts over a few thousand mean a backlog. Failed actions in the same table mean some specific action is broken — find out which and why before assuming “more processing power” fixes it.

The fix

  1. Confirm WP-Cron is firing. If you’ve disabled WP-Cron and configured system cron, verify:

    crontab -l | grep wp-cron
    tail ~/public_html/error_log

    The system cron entry should be running at least every 5 minutes (every minute for high-volume sites). Without it, Action Scheduler doesn’t run.

  2. Increase the batch size and concurrency. By default Action Scheduler processes 25 actions per batch with up to 5 concurrent batches. On a beefy server you can safely raise both. Add to a mu-plugin or theme functions.php:

    add_filter( 'action_scheduler_queue_runner_batch_size', function() { return 50; } );
    add_filter( 'action_scheduler_queue_runner_concurrent_batches', function() { return 10; } );

    Don’t go wild — too many concurrent batches can hit PHP-FPM worker limits and starve the front-end.

  3. Run the queue from the CLI to drain it without waiting for cron:

    wp action-scheduler run --batch-size=100 --batches=20

    This processes up to 2000 actions immediately. On a large backlog, repeat. CLI bypasses web timeouts, so you can drain the queue much faster than the cron pace.

  4. Identify failed actions. The queue often contains actions that throw exceptions on every retry, blocking real work:

    wp action-scheduler list-actions --status=failed --per-page=20

    For each failing action, look at what hook it’s calling and why. Common cases:

    • External API endpoint changed; the action calls it and times out.
    • Plugin uninstalled; the action references a callback that no longer exists.
    • Database row deleted out from under the action.
  5. Clean up old, completed actions. Action Scheduler keeps history by default. Over time wp_actionscheduler_actions and wp_actionscheduler_logs can grow into the millions of rows. WooCommerce > Status > Tools > Action Scheduler offers a cleanup. Or via WP-CLI:

    wp action-scheduler clean --status=complete --before='30 days ago'
  6. Check that the heartbeat trigger is firing. Action Scheduler also self-triggers from admin requests via the action_scheduler_run_queue hook. If the admin is rarely visited, this fallback doesn’t help. System cron is the reliable path.

  7. Monitor backlog as a metric. A small persistent backlog is fine. A growing backlog is a sign of either insufficient processing capacity or a specific action that’s failing and not being cleared. Stack Harbor monitors Action Scheduler depth as part of enterprise WordPress hosting ongoing ops.