WordPress6 min readPublished: 20 Nov 2024Updated: 9 Nov 2026

WordPress Cron: Fix Missed Tasks and WooCommerce

Why WP-Cron misses scheduled tasks, how that breaks WooCommerce emails and stock sync, and how to move to a server cron job that runs on time, every time.

G7Cloud Engineering
Platform team
Share:
Abstract illustration representing wordpress cron: fix missed tasks and woocommerce.
  • WP-Cron is not a true scheduler. It only fires when someone visits the site, so a quiet site runs nothing.
  • Full-page caching makes it worse: cached visits never reach PHP, so nothing starts the queue.
  • The fix has two parts: disable WP-Cron in wp-config.php, and add a server cron job that runs the queue every five minutes.
  • On WooCommerce, a stalled queue means unsent order emails, stock that is never released and subscriptions that do not renew.
  • Check the queue with wp cron event list --due-now. Anything overdue by hours confirms the diagnosis.

Why does WordPress miss scheduled tasks?

Because WP-Cron, WordPress's built-in task runner, only runs when someone loads a page. No visitors means nothing runs, so a task set for 3am on a quiet site may wait hours for the first visit. The fix is to disable WP-Cron and let the server's own clock run the queue every few minutes.

WP-CronServer cron
Triggered byA page loadThe operating system clock
Runs on a site with no trafficNoYes
Runs when pages are cachedNoYes
AccuracyWhenever someone happens to visitTo the minute
Cost per runDelays the visitor who triggered itA separate background process

Every row favours server cron. On a production site, WP-Cron is never the better option.

Caching turns a small problem into a total one

With full-page caching, most visits never reach PHP, so WP-Cron never gets called. Scheduled tasks often stop the week caching is switched on, and nobody connects the two.

How do I check whether WP-Cron is working?

WP-CLI (WordPress's command-line tool) answers this in one command. Anything in --due-now that should have run hours ago means the queue is stalled, not just busy.

Inspecting the queue
cd /var/www/example.com

# Everything scheduled, with next run times
wp cron event list

# Only what is overdue right now
wp cron event list --due-now

# Is WP-Cron even reachable?
wp cron test

# Run the whole queue by hand and see what happens
wp cron event run --due-now

# Registered schedules (hourly, twicedaily, daily, plus plugin ones)
wp cron schedule list
wp cron test checks the site can call its own wp-cron.php. It fails on servers that cannot resolve their own hostname.
Without WP-CLI
# Does the endpoint respond at all?
curl -sI https://example.com/wp-cron.php?doing_wp_cron

# Is it disabled in wp-config.php?
grep -i 'DISABLE_WP_CRON\|ALTERNATE_WP_CRON' wp-config.php

# Read the queue straight from the database
wp db query "SELECT option_value FROM wp_options WHERE option_name='cron'" \
  | head -c 2000
A 200 or 302 from wp-cron.php is normal. A 403 usually means a security plugin or firewall rule is blocking it.
SymptomAlmost certainly
Scheduled posts stay in "Missed schedule"The queue is not running at all
Order emails arrive hours late, or in burstsOnly running when a visitor happens to arrive
Backup plugin skipped last nightNo overnight traffic to trigger it
Stock stays reserved after an abandoned checkoutWooCommerce cleanup tasks are not firing
Everything runs, but the site feels slow at randomWP-Cron is running inline and delaying visitors

The last row is the other failure: WP-Cron works, but makes a visitor wait for it.

How do I replace WP-Cron with a server cron job?

Two steps. Turn off the page-load trigger in wp-config.php, then have the operating system run the queue on a fixed schedule. Every five minutes suits almost every site.

Step 1: wp-config.php
// Add above the line that says "That's all, stop editing!"
define('DISABLE_WP_CRON', true);
This stops page loads starting the queue. Nothing runs until you finish step 2, so do both together.
Step 2: the cron job
# Edit the crontab for the user that owns the site
sudo crontab -u www-data -e

# Preferred: WP-CLI, no HTTP request involved
*/5 * * * * cd /var/www/example.com && /usr/local/bin/wp cron event run --due-now --quiet

# Alternative: call the endpoint over HTTP
*/5 * * * * curl -sS -o /dev/null https://example.com/wp-cron.php?doing_wp_cron

# Confirm it is installed
sudo crontab -u www-data -l
The WP-CLI form is better. It skips the web server, so caching, firewalls and TLS cannot get in the way.

Use the site's own user, not root

WP-CLI run as root creates root-owned files in your web root, which the web server then cannot write to. WP-CLI warns and refuses by default. Use crontab -u www-data -e, or whichever user owns the site. See Linux file permissions for web servers.

Verify it is actually running
# Is cron executing the job?
grep CRON /var/log/syslog | tail -20            # Debian / Ubuntu
sudo journalctl -u crond --since '1 hour ago'  # RHEL family

# Should be empty a few minutes after each run
wp cron event list --due-now

# Log the output so you can see failures
*/5 * * * * cd /var/www/example.com && /usr/local/bin/wp cron event run --due-now \
  >> /var/log/wp-cron.log 2>&1
Log it. A cron job that fails silently looks just like one that works, until you notice a week of missing emails.

What breaks on WooCommerce when cron stalls?

More than most people expect. WooCommerce runs much of its background work through Action Scheduler, a job queue that WP-Cron starts. When the queue stalls, the shop keeps taking orders but quietly fails to finish them.

TaskWhat customers see when it stalls
Order confirmation emailsNo confirmation, followed by a support ticket
Stock release after a failed paymentProducts showing out of stock that are not
Subscription renewalsRenewals never charged, revenue quietly lost
Abandoned cart cleanupThe database grows and admin pages slow down
Product feed and stock syncMarketplace listings drift out of date
Scheduled sale pricesA sale that starts or ends on the wrong day

Rows one and three cost the most, and both fail silently.

Checking Action Scheduler
# Overall queue health
wp action-scheduler status

# Anything stuck as pending long past its date
wp action-scheduler action list --status=pending --per_page=20

# Run the queue by hand
wp action-scheduler run

# Clear out completed and failed records: this table gets very large
wp action-scheduler clean --batch-size=1000

# How big has it grown?
wp db query "SELECT COUNT(*) AS actions FROM wp_actionscheduler_actions"
A wp_actionscheduler_actions table with millions of rows is a common cause of a slow WooCommerce admin.

No command line? WooCommerce, Status, Scheduled Actions shows the same queue. Thousands of Pending entries with past dates mean cron has not been running. If the queue runs but slowly, the limit is usually the database or CPU, not the schedule. Troubleshooting high CPU and memory on WordPress helps you find which, and safely trimming a large WooCommerce database covers the table growth behind it.

How often should the cron job run, and what if it overlaps?

Every five minutes suits almost every site. Every minute is worth it for a busy shop where order emails should arrive almost at once. Anything slower than fifteen minutes starts to feel broken to a customer waiting for a confirmation.

IntervalSuitsTrade-off
*/1 * * * *Busy shops, near-instant emailsMore background load, rarely a problem
*/5 * * * *Almost every siteThe sensible default
*/15 * * * *Low-traffic brochure sitesCustomers may notice the delay on a form
0 * * * *Nothing time-sensitive at allToo slow for anything transactional

Start at five minutes. Move to one only if something clearly needs it.

Preventing overlapping runs
# flock stops a second run starting while the first is still going
*/5 * * * * /usr/bin/flock -n /tmp/wpcron-example.lock \
  /bin/sh -c 'cd /var/www/example.com && /usr/local/bin/wp cron event run --due-now --quiet'
-n means give up at once rather than wait. Without it, a run that takes eight minutes on a five-minute schedule piles up PHP processes until the site returns 502 errors.

A managed host should handle this for you. On G7Cloud, each WordPress site's container runs its scheduled tasks itself every five minutes, so quiet and heavily cached sites keep their queues moving. See how our WordPress hosting works.

Frequently asked questions

Why are my WordPress scheduled posts missing their schedule?

Because WP-Cron only fires when someone loads a page. A post scheduled for 3am on a site with no overnight visitors waits for the next visit. Full-page caching makes it worse, since cached visits never reach PHP. Replace WP-Cron with a server cron job.

Should I disable WP-Cron?

Yes, on any production site, but only as half of the change. Set define('DISABLE_WP_CRON', true); in wp-config.php and add a server cron job that runs the queue every five minutes. Disabling it without the cron job stops every scheduled task on the site.

What is the difference between WP-Cron and Action Scheduler?

WP-Cron is WordPress's own scheduler, started by page loads. Action Scheduler is a job queue that WooCommerce and many plugins use for background work, and WP-Cron starts it. If WP-Cron stalls, Action Scheduler stalls with it.

How often should the WordPress cron job run?

Every five minutes for most sites. Every minute for a busy shop where order confirmations should arrive at once. At that frequency, use flock so a slow run cannot overlap the next one and use up your PHP workers.

Is WP-CLI or curl better for the cron job?

WP-CLI. It runs PHP directly with no HTTP request, so caching, firewalls and TLS cannot interfere. Use curl only where there is no WP-CLI or shell access.

Why do my WooCommerce order emails arrive late?

Usually a stalled scheduler. WooCommerce queues most emails rather than sending them during checkout, so if nothing processes the queue they wait until a visitor starts it. Check WooCommerce, Status, Scheduled Actions for pending items with past dates.

Put this into practice on G7Cloud

Every site runs in its own dedicated container behind ScaleShield, with daily backups that are restore-tested every night. Start on the free plan, no card needed.

About G7Cloud Engineering

Platform team

Articles written by the engineers who build and run G7Cloud: UK managed hosting and the AI Website Builder. We write about what we operate every day: containers, backups, databases, and the small-business websites that run on them.

More about G7Cloud →