Fixing past-due and failed scheduled actions in WooCommerce
How to fix WooCommerce Action Scheduler problems, including past-due actions that never run, failed actions, subscription renewals not processing and oversized action tables, by fixing WP-Cron, loopbacks and plugin errors.
WooCommerce relies on a background task system called Action Scheduler to do work that doesn't need to happen while a customer waits. It sends some emails, processes subscription renewals, syncs stock with other systems, cleans up old data, runs imports and handles tasks for many other plugins such as payment gateways, marketing tools and feed generators.
When it stops working, the symptoms are scattered and confusing. Subscription renewals don't take payment. Orders don't update after payment. Emails arrive hours late. Product feeds go stale. And you may see an admin notice saying "Action Scheduler: 1,234 past-due actions found; something may be wrong."1
It usually comes down to one of a few causes, and the scheduled actions screen tells you a lot.
Look at the scheduled actions screen
Go to WooCommerce → Status → Scheduled Actions. The same screen is also under Tools → Scheduled Actions.2 You can filter the list by status:
- Pending actions are waiting to run. Most will be scheduled for the future, which is normal.
- Past-due actions are pending actions whose scheduled time has passed. A handful is fine, since the queue runs in batches. Hundreds or thousands means the queue isn't running properly.
- Complete actions ran successfully.
- Failed actions ran but threw an error.
- Canceled actions were cancelled before they ran, usually by the plugin that created them.
The Hook column tells you which plugin or feature each action belongs to. Hooks starting with woocommerce_ are WooCommerce, woocommerce_scheduled_subscription_ are Subscriptions and so on. That helps you see whether the problem affects everything or just one plugin.
Past-due actions: the queue isn't running
A build-up of past-due actions across many different hooks means the queue runner itself isn't running often enough. By default, WP-Cron triggers the runner at most once a minute. Each run processes batches of 25 actions for up to 30 seconds, and it can start extra batches with a background loopback request to your own site.3 If WP-Cron or those loopback requests are failing, the queue backs up.
Check WP-Cron is working
Go to Tools → Site Health and look for issues titled "A scheduled event has failed", "A scheduled event is late" or "Your site could not complete a loopback request".4 Any of them means WP-Cron is unreliable, and Action Scheduler will be too.
Also look in wp-config.php for this line. Download a copy of the file before you open it for editing, since a typo in it can take the whole site offline:
define( 'DISABLE_WP_CRON', true );
If it's there, WP-Cron's built-in trigger is switched off, and something else must run it. That's a good setup, as long as a real server cron job actually exists. If nobody set one up (common after moving host), nothing runs your scheduled tasks at all.
Set up a real server cron job
On a store of any size, the most reliable fix is to disable the visitor-triggered WP-Cron and run it from the server every minute or every few minutes.5 Our guide to fixing scheduled posts that fail to publish walks through the full setup. The same fix applies here.
If your host offers WP-CLI, you can also add a cron job that runs the Action Scheduler queue directly. It isn't limited by web request timeouts:6
cd /path/to/your/site && wp action-scheduler run --batch-size=50
Fix blocked loopback requests
The runner's extra batches work by your site sending a request to itself. Security plugins, firewalls, HTTP authentication on staging sites and some hosting setups block these loopback requests. Site Health will say if loopbacks are failing. Your host may need to allow requests from the server to its own domain. Our scheduled posts guide lists the usual causes.
Clearing a large backlog
Once the queue runner is fixed, a backlog will usually clear by itself over a few hours. If you need it gone sooner, or the backlog is in the tens of thousands, WP-CLI can work through it much faster than the web runner:6
wp action-scheduler run --batch-size=100 --batches=0
--batches=0 keeps going until nothing is left. You can limit it to one plugin's actions with --hooks=hook_name or --group=group_name.
Before running a big backlog, think about what those actions do. If they're thousands of old marketing emails, sync jobs or notifications, running them all now may send customers a flood of stale messages. It may be better to remove them (select them in the Past-due list and use the Delete bulk action) and let the plugin schedule fresh ones.7 Deleted actions can only be brought back by restoring a backup, so check what you've selected before you confirm.
Never bulk-delete pending woocommerce_scheduled_subscription_payment actions. Those are your customers' future renewals. Equally, if the backlog includes past-due renewals, running it will try to charge those customers, possibly days late. Check your subscriptions plugin's documentation (and, if you're unsure, your payment provider) on how late renewals are handled before running them in bulk.
Failed actions: find the error
Failed actions are a different problem. The queue ran, but the task threw an error. Click the action to see its log entries, which include the error message.2
Common errors and what they mean:
- "Scheduled action for X will not be executed as no callbacks are registered" means the plugin that created the action is no longer active.8 If you removed the plugin on purpose, these can safely be left to be cleaned up. If you didn't, check whether the plugin has been deactivated, or closed and removed.
- "action failed via WP Cron" followed by a PHP error means the task crashed.9 The message usually names a plugin file. Check that plugin is up to date and look in WooCommerce → Status → Logs for fatal errors at the same time. If it started after an update, see our guide to recovering a site broken by an update.
- "action was in-progress for at least 300 seconds without completing and has been marked as failed" means the task started but never finished.9 Usually PHP ran out of time or memory partway through. Check your server's PHP error log for the same time. The task may be processing too much data at once, or waiting on a slow external service.
- Errors mentioning an order or product that doesn't exist usually mean it was deleted after the action was scheduled. These are usually harmless, but check the order or product really was deleted on purpose.
If failed actions are mostly from one plugin, contact that plugin's support with an example of the error. The problem is in their code, not in Action Scheduler.
Subscription renewals not processing
For WooCommerce Subscriptions, renewal payments are scheduled actions with the hook woocommerce_scheduled_subscription_payment. If renewals aren't taking payment, search for that hook in the Past-due and Failed lists.
Past-due renewals mean the queue isn't running (see above). Failed renewals usually show a payment gateway error in their log. The subscription's own notes, on the subscription edit screen, often have more detail about why a payment attempt failed.
After fixing the cause, past-due renewals will process when the queue runs. If renewal orders are then created but stay unpaid, see our guide to orders stuck on Pending payment.
Oversized action tables
Action Scheduler stores every action and its log in its own database tables, usually wp_actionscheduler_actions and wp_actionscheduler_logs. Completed and cancelled actions are cleaned up automatically after 31 days, and failed actions after three months.10 But if the cleanup task itself can't run, or a plugin schedules huge numbers of actions, these tables can grow to millions of rows and slow down the whole admin area.
Once the queue is running again, cleanup will catch up gradually. If the tables are enormous, the wp action-scheduler clean WP-CLI command deletes old actions in batches. By default it removes completed and cancelled actions older than 31 days.6 Take a database backup first. If one plugin is creating far more actions than seems reasonable, check its settings or raise it with the developer. Our guide to fixing a slow WordPress admin dashboard covers other kinds of database bloat.
Still seeing past-due actions?
If you've confirmed cron is running but actions still pile up, the queue may be too slow for the amount of work your store generates, or something is making each batch take too long. That needs someone to dig into server resources and the plugins doing the scheduling. If your server is also showing 502, 503 or 504 errors at busy times, the two problems are probably linked. My WordPress development service and emergency WordPress support cover WooCommerce background processing, subscription renewal problems and cron configuration.
ActionScheduler_AdminView.php, Action Scheduler source code on GitHub. ↩
Performance tuning, Action Scheduler documentation. ↩
class-wp-site-health.php, WordPress source code on GitHub. ↩
Hooking WP-Cron into the system task scheduler, WordPress Plugin Handbook. ↩
ActionScheduler_ListTable.php, Action Scheduler source code on GitHub. ↩
ActionScheduler_Action.php, Action Scheduler source code on GitHub. ↩
ActionScheduler_Logger.php, Action Scheduler source code on GitHub. ↩ ↩
ActionScheduler_QueueCleaner.php, Action Scheduler source code on GitHub. ↩