WordPress

WP-Cron

WP-Cron is WordPress's scheduler. Instead of a system clock it checks for due tasks whenever someone loads a page, so jobs run late on a quiet site.

How it is measured

Scheduled events are stored in the cron option in wp_options. When a request arrives and something is due, WordPress sends a non-blocking loopback request to wp-cron.php. List events with wp cron event list, which shows the hook name, next run time, and recurrence, and run overdue ones with wp cron event run --due-now.

Core uses it to publish scheduled posts, check for updates, and clear expired transients. Plugins use it for backups, emails, and imports.

Worked example

A club newsletter site posts a scheduled article for 8:00 am. Traffic is near zero overnight, so the first visitor arrives at 8:47 and the post goes live then, with a Missed schedule status in older versions.

The admin sets DISABLE_WP_CRON to true in wp-config.php and adds a system cron entry that runs wp cron event run --due-now every 5 minutes. The next scheduled post goes live at 8:00 to 8:05.

How it differs

WP-Cron is a pseudo-scheduler inside WordPress that depends on traffic. A system cron runs at fixed times whether anyone visits or not. On a busy site WP-Cron wastes work by checking on each request, and on a quiet one it drifts. The object cache does not change this, but a broken loopback request does.

Common errors

Assuming events run at the exact time. Leaving the default on a high-traffic site so every request checks the queue. Disabling it without adding a system cron. Blocking loopback requests with basic auth or a firewall. Scheduling thousands of one-off events with no cleanup.

In practice

Run wp cron event list and look for events that are hours overdue. On any site that matters, disable the default trigger and call it from a real cron every one to five minutes. Check Site Health for a loopback failure.

See also

WordPress, Object cache

Sources

Count this on a real site.

Watch my website