WP-Cron: replacing it with a real cron job
How WordPress’s built-in scheduler works, why scheduled tasks can run late on quiet sites, and how to run WP-Cron from a DirectAdmin cron job.
WordPress has its own scheduler, WP-Cron, which handles scheduled posts, update checks, backup plugins and shop tasks.
The catch
WP-Cron doesn’t run on a timer. It checks for due tasks when someone visits the site.
- On a quiet site, tasks run late — scheduled posts appear “Missed schedule”.
- On a busy site, the check runs on many visits, adding overhead.
Run it from a real cron job
1. Disable the visit-triggered check in wp-config.php, above /* That's all, stop editing! */:
define('DISABLE_WP_CRON', true);2. Create a cron job in Advanced Features › Cronjobs that runs every 15 minutes:
| Field | Value |
|---|---|
| Minute | */15 |
| Hour | * |
| Day of month | * |
| Month | * |
| Day of week | * |
Command:
/usr/local/bin/php /home/USERNAME/domains/yourdomain.co.uk/public_html/wp-cron.php >/dev/null 2>&1Replace USERNAME with your DirectAdmin username and adjust the path if WordPress is in a subfolder. The PHP path can differ; see Running PHP scripts from cron: paths, output and common mistakes for how to confirm it.
Check it works
Schedule a test post a few minutes ahead and confirm it publishes. Many cron-management plugins also show when events last ran.
Every 5 minutes suits shops; hourly is fine for simple brochure sites.
Prefer to follow along?
- Speed up a slow WordPress site
Advanced · 60 min
Choosing somewhere to host WordPress? Traxio’s WordPress hosting includes one-click installs, LiteSpeed caching and free SSL.
Common questions
What does “cURL error 28: Operation timed out” mean?
Your site tried to fetch something from another server and got no answer in time. In WordPress it usually appears in Site Health and points at a slow external API, a plugin’s licence check, or WP-Cron calling the site itself.
What is WP-Cron and why do my scheduled posts not publish?
WP-Cron is WordPress’s own scheduler, and it only runs when somebody visits the site. On a quiet site nothing triggers it, so scheduled posts and backups are late or never run.
The fix is to turn off the visitor-triggered version and call it from a real cron job instead, which runs on a fixed schedule whether or not anyone is visiting.
Spotted something out of date or unclear? Tell us and we’ll fix it.