SEAKSES · 30+ Global DNS Resolvers, SSL/PKI Suite & Open REST APISpotted a bug or have an idea?

Thinking wp-cron Runs on a Schedule? It Only Fires When Someone Visits

Candra Octavian RamadhaniBy Candra Octavian Ramadhani·2026-12-01T15:09:38+08:00·7 min read
Key Takeaway

Scheduled posts, backups, or emails run late or not at all on low-traffic WordPress sites, while busy sites trigger wp-cron on almost every request. You will learn how WP-Cron is triggered by page loads, how to confirm it with wp cron event list, and how to replace it with DISABLE_WP_CRON and a real system cron job.

Many site owners assume WordPress has a clock running inside it. You schedule a post for 9:00, set a backup plugin to run at 2:00 AM, and queue a newsletter for Monday morning, and you expect each one to fire at that minute. WP-Cron does not work that way. WordPress only checks for due tasks when a request reaches it, so on a quiet site tasks run late or not at all, and on a busy site the check happens on almost every page load.

Once you understand what triggers WP-Cron, both of those symptoms make sense, and the fix is usually small.

What a real cron does and what WP-Cron does instead

On a Linux server, cron is a daemon, a background process that is always running. It wakes up every minute, reads the crontab files, and runs any command whose time matches. Whether anyone visits your website makes no difference to it. A job set for 3:00 AM runs at 3:00 AM.

WP-Cron is a list of scheduled events stored in the database. Each event has a hook name (the action WordPress will fire), a timestamp, and optionally a recurrence such as hourly or daily. The list lives in the cron row of the wp_options table. Nothing watches that list on its own.

Instead, on each request that loads WordPress, it checks whether any event's timestamp has passed. If one has, WordPress sends a background HTTP request to its own wp-cron.php file. This is called a loopback request, because the server is calling itself. That second request runs the due events, while the visitor's page carries on loading. The WordPress developer documentation on WP-Cron scheduling describes the same model. Some guides call it a pseudo-cron.

This means the time you set on a WordPress schedule is the earliest moment the task may run. It is not the moment the task will run.

Why quiet sites run late

Suppose a backup is scheduled for 2:00 AM and nobody visits the site until 7:00 AM. The backup is due at 2:00, but WordPress does not find out until the first request at 7:00. It runs then, five hours late. A scheduled post behaves the same way. If no request arrives after its publish time, the post stays unpublished and WordPress eventually marks it as missed. The causes and symptoms on low-traffic sites are covered in Why WordPress Shows Missed Schedule on Posts When the Site Gets Little Traffic.

Recurring events do not catch up. If an hourly task misses six hours because nobody visited, it typically runs once when traffic returns and is then rescheduled forward. It does not run six times. For a cleanup job that is fine. For something that must happen every hour, such as syncing orders or sending queued mail, it quietly breaks the expectation.

Two other situations stop WP-Cron on sites that do get visitors.

The first is page caching. If a full-page cache at the web server, a caching plugin served directly by the server, or a CDN answers the request, PHP never runs. WordPress never loads, so it never checks the event list. A site can show plenty of traffic in analytics while very few requests actually reach WordPress.

The second is a failed loopback request. The visitor's request finds a due event and tries to call wp-cron.php, but the call fails. Common reasons include HTTP basic auth on a staging site, a firewall or security rule that blocks the server from calling its own public address, and DNS that still points to an old server after a migration. In these cases the events stay overdue no matter how much traffic arrives.

In support, "my scheduled post didn't publish" and "the backup plugin says the last backup was days ago" usually trace back to one of these causes. Checking which one applies comes before changing anything.

Why busy sites have the opposite problem

On a high-traffic site, the check runs on every uncached request. The check itself is cheap, because the cron list is loaded with other options at startup. The extra work starts when an event is due.

WordPress sets a short-lived lock, a transient named doing_cron, before it spawns wp-cron.php. It will not spawn again until that lock expires. The lock duration is controlled by WP_CRON_LOCK_TIMEOUT, which defaults to 60 seconds. A transient is a value written to the database or object cache, so it is not a strict lock. When many requests arrive at the moment an event becomes due, several of them can see no lock and spawn cron at the same time. The MainWP article on WP-Cron describes this pattern as duplicate processing, database locks, and extra server load.

There is also a capacity cost. A spawned wp-cron.php request is an ordinary web request. It uses a PHP worker from the same pool that serves visitors, and it is subject to the same web server and PHP time limits. A heavy task such as an import, a large email batch, or an image regeneration job holds that worker for its whole duration. During a traffic peak, that worker is one fewer available for visitors.

The outcome on busy sites is timing that is roughly right but less predictable, with background work competing for the same resources as page loads.

Check what is actually scheduled

WP-CLI, the WordPress command-line tool, shows the event list directly, so you don't need to guess from plugin dashboards. Run these from the WordPress root as the user that owns the site files, not as root.

# List scheduled events with their next run time and recurrence
wp cron event list --fields=hook,next_run_gmt,next_run_relative,recurrence

# Check whether WordPress can spawn wp-cron.php through a loopback request
wp cron test

In the event list, the next_run_relative column is the one to read first. On a healthy site, most events show a time in the near future. If several events show a time in the past, often hours or days ago, then nothing has triggered WP-Cron since they became due. That points to low traffic, page caching that bypasses PHP, or a broken loopback.

wp cron test helps you tell those apart. If it reports that spawning failed, the loopback request is the problem, and adding traffic will not fix it. If it succeeds but events are still overdue, the likely cause is that too few requests reach PHP.

While the list is open, look for hooks from plugins that are no longer installed. Those events are harmless individually, but they stay in the cron option indefinitely.

Replace page-load triggering with a system cron job

The production pattern is to stop WordPress from spawning cron on page loads and let the system cron daemon run it on a fixed interval. The steps are:

  1. Disable the page-load trigger in wp-config.php.
  2. Add a system cron job that runs due events.
  3. Confirm that events are being processed.

For step 1, add this line to wp-config.php above the line that says /* That's all, stop editing! */:

define( 'DISABLE_WP_CRON', true );

This setting only stops the automatic spawning on visitor requests. Scheduled events are not deleted, and wp-cron.php can still be called directly.

For step 2, add a crontab entry for the site user, either with crontab -e or through your control panel's cron jobs page. With WP-CLI installed, a typical entry looks like this. The paths are illustrative and must match your server.

*/5 * * * * flock -n /tmp/example-wp-cron.lock /usr/local/bin/wp --path=/home/example/public_html cron event run --due-now --quiet >> /home/example/logs/wp-cron.log 2>&1

Several parts of this entry matter:

  • */5 runs the job every five minutes. That is a common rule of thumb. A shorter interval gives more precise timing at the cost of more process starts. A longer one suits sites with only daily tasks.
  • Use a full path to wp, because cron runs with a minimal PATH. You can find the path with command -v wp in a normal shell session as the same user.
  • flock -n skips a run if the previous one is still going. This prevents long jobs from overlapping.
  • Sending output to a log file instead of /dev/null keeps errors visible.

Running through WP-CLI also means the work happens in PHP CLI, not in a web worker. Visitors do not compete with it for PHP-FPM slots, and it is not cut off by web server timeouts. If WP-CLI is not available, you can instead call wp-cron.php over HTTP with curl or wget. That works, but the request goes back through the web server with the same limits as before.

On a multisite network, wp cron event run --due-now processes one site, the one given by --url or the main site. Each subsite needs its own run, usually by looping over wp site list.

For step 3, run wp cron event list again after the job has had time to fire. Overdue events should be gone, and the log file should contain no errors.

Be aware of one risk with this setup. With DISABLE_WP_CRON set, page loads no longer trigger anything, so if the system cron job is misconfigured, nothing scheduled will run at all. A wrong path, the wrong user, or a PHP binary without the required extensions can all cause this, and there is no fallback. How to Verify Your WordPress System Cron Job Is Actually Running walks through confirming each run.

In practice, treat every time in a WordPress schedule as "no earlier than" unless a system cron is driving it. When tasks run late, start with wp cron event list and wp cron test to find out whether nothing is triggering cron or whether the trigger is failing. Then move timing-sensitive sites to DISABLE_WP_CRON with a WP-CLI cron job, and check the event list afterwards to confirm it is working.