Scheduled posts showing “Missed schedule”, WooCommerce order emails arriving hours late, backup plugins that quietly stopped running — behind Cloudflare, this cluster of symptoms is wp-cron starving. WordPress has no real scheduler: it piggybacks on page loads, and it fires a loopback HTTP request to itself to run due tasks. Cloudflare interferes with both halves — edge caching absorbs the page loads, and security features can challenge or block the loopback. The durable fix is the same in every case: disable pseudo-cron and drive wp-cron from the system crontab.
What’s happening
On every uncached page load, WordPress checks whether any cron event is due and, if so, spawns a non-blocking request to https://your-site/wp-cron.php to process the queue. Two assumptions hide in that design: pages are served by PHP often enough to check the schedule, and the site can reach its own public URL.
Cloudflare breaks assumption one with caching. With APO or a Cache Everything rule, the vast majority of anonymous traffic terminates at the edge — cf-cache-status: HIT responses never execute PHP, never check the schedule, never spawn cron. A store with 50,000 edge-served visits a day can genuinely have only a trickle of origin hits, so events queue up until a logged-in user happens to load a page.
It breaks assumption two with security. The loopback request leaves your server, resolves the site’s public DNS — which now points at Cloudflare — and comes back in through the proxy like any stranger. Bot Fight Mode, Under Attack Mode, a country rule, or a WAF custom rule can hand that request a challenge page. wp-cron.php cannot solve a challenge; the spawn dies silently and WordPress does not log a thing. A server IP with a poor reputation, or a rule that blocks requests with no browser fingerprint, produces the same result.
What to check first
- Is HTML being cached at the edge (APO or Cache Rules)? Heavier caching means fewer organic cron triggers.
- Does Security > Events show your own server’s public IP being challenged or blocked on
/wp-cron.php? - Is
DISABLE_WP_CRONalready defined inwp-config.php— with no system cron replacing it? Half-finished migrations are common. - Hosting layer: some hosts run their own cron caller; check before adding a second one.
How to verify
Measure the backlog first, then test the loopback path:
# How far behind is the queue? Look for next_run times in the past.
wp cron event list --fields=hook,next_run_relative --path=/var/www/html
# Does the loopback survive the Cloudflare round trip?
curl -sI https://www.example.com/wp-cron.php \
| grep -iE '^HTTP/|cf-mitigated|cf-cache-status'
# From the server itself (the IP that actually matters):
curl -sI --max-time 10 https://www.example.com/wp-cron.php | head -5
Healthy: HTTP/2 200 and no cf-mitigated header. Sick: 403 with cf-mitigated: block, or a challenge response your server can never answer. Cross-check in Security > Events filtered by your server’s public IP — a wall of challenged POST /wp-cron.php entries is the confession. Finally, wp cron test reports whether WordPress itself believes spawning works.
The fix
- Stop relying on traffic. In
wp-config.php, disable the page-load trigger:
define('DISABLE_WP_CRON', true);
- Add a real scheduler. Run the queue from the system crontab every minute (every five is fine for low-stakes sites), using WP-CLI so the request never crosses Cloudflare at all:
# crontab -e (as the site's PHP user)
* * * * * cd /var/www/html && /usr/local/bin/wp cron event run --due-now >/dev/null 2>&1
- No WP-CLI available? Use curl against the origin directly, bypassing the proxy, so no edge rule can interfere:
* * * * * curl -s --resolve www.example.com:443:203.0.113.10 \
"https://www.example.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
- If you must keep loopback through Cloudflare (managed hosting without crontab access), create a WAF skip rule scoped to URI path
/wp-cron.phpand your server’s IP as the source — never a blanket skip on the path alone, which invites the exact floods the WAF exists for. - Drain the backlog once:
wp cron event run --due-nowmay need a couple of passes; verify withwp cron event listthatnext_run_relativevalues point to the future again.
The full migration, including multisite wrinkles and monitoring the runner itself, is covered in replacing wp-cron with a system cron.
When this fix is wrong
- Events run but their work fails — emails queued yet undelivered, backups starting and dying. That is the task’s problem (SMTP, disk, PHP limits), not the scheduler’s.
- Only one plugin’s schedule misbehaves while
wp cron event listshows the rest running on time: debug that plugin’s hook, not the trigger mechanism. - The host already runs a server-side cron caller — adding yours doubles executions; some tasks (imports, billing) are not idempotent.
Common mistakes
- Defining
DISABLE_WP_CRONand forgetting the crontab entry — everything scheduled now silently never runs, which is worse than slow. - Pointing the cron curl at the public hostname through Cloudflare anyway, then losing an hour when a new security rule challenges it. Use WP-CLI or
--resolve. - Allowlisting the server IP zone-wide “so cron works”, which also exempts the server from every protection if it is ever compromised.
- Running the cron as root, leaving root-owned cache files that break the site’s PHP user later.
- Assuming APO is innocent because “it only caches HTML” — cached HTML is precisely the traffic that used to trigger cron.
Prevention
- Treat “moved behind Cloudflare” and “enabled APO” as events that require a cron check: run
wp cron event listafter each and look at the timestamps. - Monitor freshness, not the mechanism: alert when the oldest due event is more than 15 minutes overdue.
- Keep the caching design intentional — what should and should not be cached at the edge is laid out in Cloudflare cache rules that pay off on WordPress, and Cloudflare’s caching behaviour reference is the cache documentation.
A store whose emails, renewals, and backups depend on random page hits is one caching improvement away from silence. Need Cloudflare stabilized in front of a WordPress or WooCommerce site that earns money? Stack Harbor runs that exact stack under managed enterprise WordPress hosting — book an infrastructure consult.