OPTIMIZATION FREE

Action Scheduler Optimizer

Health dashboard, automatic cleanup, and runner tuning for Action Scheduler — the WooCommerce job queue whose tables grow to gigabytes unnoticed.

What It Does

Action Scheduler is the background job queue used by WooCommerce and many other plugins. Left alone, its tables (actionscheduler_actions and actionscheduler_logs) accumulate millions of completed and failed rows that slow down the admin, cron, and the database. This module gives you an A–F health grade with the factors behind it, batched cleanup by status (completed, failed, canceled, logs, orphaned logs), a scheduled auto-cleanup with per-status retention windows, one-click fixes for stuck and past-due actions, and a tuner that adjusts Action Scheduler's runner behavior using Action Scheduler's official filter hooks — no core hacks.

Features

  • A–F health grade based on table size, row counts, stuck actions, past-due actions, and failure rate — with the specific factors listed
  • Live dashboard: table sizes, status counts (pending / in-progress / complete / failed / canceled), processing rate per hour, failed actions in the last 24h, and oldest pending action
  • Top hooks table showing which plugins create the most actions, broken down by status
  • Recommendations with one-click actions: "Unstick" releases actions claimed but abandoned for over 10 minutes, "Run Queue Now" processes past-due pending actions immediately
  • Cleanup by type: completed, failed, and canceled actions plus log entries, each respecting its own retention window
  • Orphaned log cleanup — removes log rows whose parent action no longer exists
  • All deletes run in batches of 1,000 rows with LIMIT, so cleanup never locks large tables
  • Nuclear clean: wipe all non-active actions and all logs at once — guarded by a typed "NUCLEAR" confirmation
  • Automatic scheduled cleanup via WP-Cron (hourly, every 6 hours, every 12 hours, or daily) with per-status retention: completed 1 day, failed 3 days, canceled disabled, logs 3 days by default (0 disables a category, 31-day cap)
  • Weekly automatic OPTIMIZE TABLE on all four Action Scheduler tables, plus on-demand optimization
  • Runner tuner using Action Scheduler's own filters: retention period, cleanup batch size, include-failed-in-cleanup, runner batch size, time limit, concurrent batches, async runner on/off, logging on/off (NullLogger), and claim lock duration
  • Tuner shows Action Scheduler's original defaults next to your values, so you always know what you changed
  • Detects when Action Scheduler is not installed and says so instead of showing empty stats

How to Use

  1. Open the dashboard

    Go to WP Multitool > Action Scheduler. The dashboard loads your health grade, table stats, status counts, top hooks, and recommendations.

  2. Read the health grade

    A or B means the queue is healthy. C, D, or F point to oversized tables, stuck actions, or past-due backlogs — the listed factors tell you exactly which.

  3. Handle stuck and past-due actions first

    If recommendations show stuck actions, click "Unstick" to release them. If pending actions are past due, click "Run Queue Now" — and check that WP-Cron or a system cron is actually firing.

  4. Clean up the backlog

    Use the per-type cleanup buttons to purge old completed, failed, and canceled actions and logs. Deletes are batched, so even million-row tables clean safely.

  5. Enable auto-cleanup

    Turn on scheduled auto-cleanup so the tables stay small. The defaults (completed after 1 day, failed after 3, logs after 3) suit most shops; adjust the retention windows if you need longer history.

  6. Tune the runner if needed

    On high-volume shops, raise the runner batch size or concurrent batches so the queue drains faster. Changes apply through Action Scheduler's official filters on the next page load.

Settings

SettingDefaultDescription
Auto-cleanup On, every 6 hours Scheduled cleanup via WP-Cron. Schedule options: hourly, every 6 hours, every 12 hours, daily.
Retention: completed 1 day Completed actions older than this are purged. 0 disables this category; maximum 31 days.
Retention: failed 3 days Failed actions older than this are purged. 0 disables; maximum 31 days.
Retention: canceled 0 (disabled) Canceled actions are kept by default. Set a day count to purge them too.
Retention: logs 3 days Log entries older than this are purged. 0 disables; maximum 31 days.
Weekly table optimization On Runs OPTIMIZE TABLE on the four Action Scheduler tables once a week to reclaim disk space.
Runner batch size 25 Actions processed per runner batch (5–200). Raise on high-volume shops with server headroom.
Runner time limit 30s Maximum seconds per queue-runner pass (5–120).
Concurrent batches 1 Parallel queue runners (1–10). More drains the queue faster but increases server load.
Disable logging Off Switches Action Scheduler to a null logger — stops log table growth entirely, at the cost of losing job history.

FAQ

Is it safe to delete completed and failed actions?

Yes. Completed, failed, and canceled actions are historical records of jobs that already ran (or definitively did not) — they are not pending work. Pending and in-progress actions are never touched by any cleanup in this module.

What does "Nuclear clean" delete exactly?

All complete, failed, and canceled actions plus all log entries — regardless of age. Pending and in-progress actions survive. It requires typing NUCLEAR to confirm. Use it when the tables are so large that retention-based cleanup would take too long.

How is this different from the Action Scheduler cleanup in Database Optimizer?

Database Optimizer includes a basic one-shot purge of completed/failed entries as part of general database cleanup. This module is the full toolset: health grading, per-status retention schedules, stuck-action recovery, queue triggering, and runner tuning.

I don't run WooCommerce — is this module useful?

Only if another plugin bundles Action Scheduler (many do: WP Mail SMTP, Yoast, various backup and marketing plugins). If Action Scheduler is not installed at all, the module simply reports that and does nothing.

Why are my pending actions past due?

Usually because WP-Cron is not firing reliably (low-traffic site, DISABLE_WP_CRON set without a system cron, or a stuck queue claim). Click "Run Queue Now" to drain the backlog immediately, then click "Unstick" if actions are stuck in claims, and set up a real system cron for a permanent fix.

Does the tuner modify Action Scheduler files?

No. Every tuning option is applied through Action Scheduler's own public filter hooks (action_scheduler_queue_runner_batch_size, action_scheduler_retention_period, and so on). Disable the module and the defaults return.

Ready to optimize your WordPress site?

Join developers using WP Multitool to debug, optimize, and maintain WordPress.

Get WP Multitool