Skip to content

Cron and WP-CLI

WordPress has no clock of its own. WP-Cron, which runs the warmer on its schedule, is only checked when somebody loads a page. A shop with little traffic at night is exactly the shop whose scheduled jobs never fire, and night is when the warmer has the most room to work.

If the dashboard says Warming has stopped or Nothing has run yet, or the number of URLs never warmed does not go down on its own, give the warmer a real cron entry.

The How it works tab shows the three routes below with your site’s own paths already filled in, and a live read of your cron setup.

They are in order of how well they hold up on shared hosting, best first.

Works on any hosting with a cron panel. It needs no shell and no WP-CLI. It runs the warmer and nothing else, so it can neither hold up nor be held up by other plugins’ scheduled jobs.

  1. In wp-admin, open Cache Warmer > Settings, panel Running the worker, and copy the Cron command. It looks like this:

    Terminal window
    wget -q -O - "https://example.com/?brl_scw_run=YOUR_KEY" >/dev/null 2>&1
  2. In cPanel, open Cron Jobs under Advanced. On Plesk it is Scheduled Tasks; other panels call it Cron.

  3. Set the schedule to every five minutes: */5 in the minute box, * in the other four.

  4. Paste the whole line into the Command box.

If the server has no wget, use curl -s "URL" >/dev/null 2>&1 with the same address.

For an external cron service such as cron-job.org, or a monitor that pings a URL, use The address on its own instead.

Wait for two runs, then check Last run on the dashboard or the How it works tab, or open the Log tab. The number of URLs never warmed should go down on its own.

The address runs one batch and nothing else. It works only with the random key generated on your site; a wrong key gets a 403. A cron entry cannot send a login or a nonce, so the key is the credential. Treat the address like a password.

  • It warms one batch whether or not the Worker switch is on. Leave the switch on anyway: the worker interval still decides which URLs count as due.
  • The response is a short line of plain text, such as ok: 15 URLs, 30 requests, 4.2s.
  • Adding &task=rebuild to the address re-reads the sitemap instead of warming.

To replace the key, click Generate a new key under Settings > Running the worker. The old address stops working immediately, so update your cron entry straight after.

Everything the dashboard buttons do, without a browser waiting on it.

Command What it does
wp brl-scw run Runs one batch, exactly as cron would. Safe in a cron entry. Does nothing while the Worker switch is off.
wp brl-scw rebuild Rebuilds the queue from the sitemap, or from published content when there is none.
wp brl-scw warm <url> Warms one URL now and prints the HTTP code and what the desktop and mobile buckets answered.
wp brl-scw status Prints the queue size, URLs never warmed, URLs warmed in 24 hours, the cold share, the cache header and the time for a full cycle.
wp brl-scw reset Clears every warm result, so the whole queue is due again. Does not purge the cache.

Before version 1.2.3 the command was wp brl-warmer. The old name still works, so existing cron entries keep running.

That is not a problem by itself; it is the better setup, as long as something outside WordPress really calls wp-cron.php. If Next run on the dashboard is not overdue, your server cron is alive.

wp cron test always fails when the constant is set. It only tests the visitor-driven path, which you turned off on purpose.

“Run one batch now” hangs the admin page

Section titled ““Run one batch now” hangs the admin page”

Your server is handling one PHP request at a time. Run one batch now warms inside the admin request, and the warm requests queue behind the very request that sent them, so neither can finish. It shows up on local dev servers and on a php-fpm pool sized to a single worker. Normal hosting does not do this.

Let the background worker or a cron entry do the warming instead, or raise the number of PHP workers.