WordPress relies on a system called WP-Cron for scheduled tasks — publishing posts, sending emails, running backups, clearing caches. But WP-Cron has a quirk that catches people out, and the fix makes your whole site more reliable and slightly faster.

The problem with default WP-Cron

Despite the name, WP-Cron isn’t a true scheduler. It only runs when someone loads a page on your site. On a busy site that’s fine, but on a quieter one, a task scheduled for 3am won’t run if nobody visits at 3am. That’s why scheduled posts get missed and backups don’t fire on time.

There’s a second downside: on a busy site, WP-Cron runs on every page load, checking for due tasks. That’s a small amount of wasted work on every single visit.

The fix: a real server cron job

The solution is to disable the visitor-triggered behaviour and instead run WP-Cron on a fixed schedule via a proper server cron job. Two steps.

Step 1: Disable the default WP-Cron

Add this to wp-config.php:

define('DISABLE_WP_CRON', true);

Now WordPress won’t trigger cron on page loads.

Step 2: Create a server cron job in cPanel

  1. In cPanel, open Cron Jobs.
  2. Set the schedule to every 15 minutes.
  3. Enter this command:
*/15 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Now scheduled tasks fire reliably every 15 minutes regardless of traffic.

Choosing the interval

Every 15 minutes suits most sites. If you have time-sensitive tasks, go to every 5 minutes. Don’t set it wildly frequent, though — running cron every minute on a resource-limited plan just adds needless load.

Verify it’s working

Schedule a test post a few minutes out and confirm it publishes on time. A cron-monitoring plugin can also show you which scheduled events are registered and when they last ran, so you can confirm everything fires as expected.

Watch for plugins blocking wp-cron.php

Some security plugins block direct requests to wp-cron.php. If your new cron job doesn’t seem to run, whitelist that file in your security settings.

This is exactly the setup we configure for content-heavy and e-commerce clients — it’s the reliable way to run scheduled tasks. Ask us if you’d like a hand.

Was this article helpful to you?

admin

Leave a Reply

You must be logged in to post a comment.