A cron job is a scheduled task that runs automatically at predetermined intervals on a server. The name comes from the Unix/Linux cron utility — a time-based job scheduler that executes scripts or commands without any manual trigger. In the context of WordPress, cron jobs handle background tasks like publishing scheduled posts, checking for plugin and theme updates, sending automated emails, and clearing expired transients.
Cron jobs are how WordPress keeps itself running automatically behind the scenes. Most site owners never think about them — until something breaks. A missed schedule, failed backup, or stopped email queue is often traceable to a cron job that isn’t firing correctly. Understanding how WordPress handles scheduled tasks, and the limitations of its default approach, is worth knowing if you rely on time-sensitive automation on your site.
WP-Cron vs. Server Cron
WordPress ships with its own scheduling system called WP-Cron. The key distinction between WP-Cron and a real server cron job is how they’re triggered:
WP-Cron: Triggered by page loads. Every time someone visits your site, WordPress checks whether any scheduled tasks are due and runs them at that moment. This approach works reasonably well for sites with consistent traffic but has a significant limitation — if no one visits your site at the scheduled time, the task doesn’t run. A scheduled post at 3 AM on a low-traffic site might not publish until the next visitor arrives.
Server cron (real cron): Set at the server level using the operating system’s cron utility. Runs on an actual time schedule — every 5 minutes, once a day at 2 AM, or any interval you define — regardless of whether anyone is visiting the site. This is more reliable, especially for backup tasks, scheduled publishing, and any automation where timing matters.
How to switch: The recommended approach is to disable WP-Cron’s page-load trigger by adding define('DISABLE_WP_CRON', true); to your wp-config.php file, then adding a server-level cron entry that calls WordPress’s cron endpoint on a schedule. Many managed WordPress hosts offer this as a setting in their control panel.
[Image: Comparison table showing WP-Cron (visitor-triggered, unreliable timing) vs. server cron (time-triggered, reliable)]
Purpose & Benefits
1. Keeps WordPress Features Running Automatically
WordPress core uses scheduled tasks for essential maintenance: checking for plugin and theme updates, publishing posts on schedule, cleaning up expired transients and sessions, and sending notification emails. Without working cron jobs, these processes fall behind or stop entirely. Our WordPress hosting solutions run real server-side cron to ensure these tasks fire reliably.
2. Enables Reliable Backup and Maintenance Automation
Plugins like UpdraftPlus, WP Time Capsule, and Jetpack Backup all rely on cron to trigger scheduled backups. If WP-Cron isn’t firing at the expected time, your backup schedule silently falls apart. Switching to a real server cron ensures critical maintenance tasks run precisely when configured, not whenever a visitor happens to arrive.
3. Powers Plugin Functionality That Depends on Timing
Many plugins use WordPress’s scheduling API (via wp_schedule_event() and wp_schedule_single_event()) to trigger their own processes: email marketing plugins sending queued messages, WooCommerce clearing expired cart sessions, event plugins publishing or expiring content, and caching plugins running optimization routines. These all depend on reliable cron execution. See also database optimization routines that run on cron schedules.
Examples
1. Scheduled Post That Fails to Publish
A blog editor sets a post to publish at 8:00 AM. The site uses WP-Cron and has relatively low morning traffic. No visitor triggers a page load between 7:55 and 8:10 AM, so the scheduled task doesn’t run. The post appears as “missed schedule” in the dashboard — a common WP-Cron failure mode. Switching to a server cron that runs every 5 minutes would have prevented this.
2. Plugin Using Custom Cron Intervals
A WooCommerce store uses a plugin that sends post-purchase follow-up emails 48 hours after an order is placed. The plugin registers a custom cron event via wp_schedule_single_event() for each order. If WP-Cron is unreliable on this site, follow-up emails go out late or not at all — directly affecting the customer experience.
3. Server Cron Configuration
On a Linux server, a real cron entry to trigger WordPress’s cron system every 5 minutes looks like this:
# Run WordPress cron every 5 minutes
*/5 * * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
Alternatively, using WP-CLI is often preferred because it runs in the WordPress context and handles return codes properly:
# Run WordPress cron via WP-CLI every 5 minutes
*/5 * * * * cd /var/www/html && wp cron event run --due-now --quiet
This ensures WordPress scheduled tasks run on a real time schedule, independent of visitor traffic.
Common Mistakes to Avoid
- Disabling WP-Cron without adding a server cron replacement — Adding
DISABLE_WP_CRONto wp-config.php without setting up a real server cron leaves no mechanism to run scheduled tasks. Always configure the replacement before disabling the default. - Not monitoring cron job health — Cron failures are silent. Plugins like WP Crontrol let you see all scheduled tasks, their next run times, and whether events are overdue. Running periodic audits prevents backlog buildup.
- Too many redundant scheduled tasks — Deactivated plugins sometimes leave their cron events behind, and duplicate schedules from multiple backup plugins can add unnecessary load. Use WP Crontrol or a site audit to identify and clean up orphaned tasks.
- Ignoring wp-config.php changes when migrating — If you switch hosts and the new server doesn’t set up a replacement cron, disabling WP-Cron on the old server carries over — and nothing runs on the new server either. Always verify cron setup as part of any migration.
Best Practices
1. Audit Your Scheduled Tasks Regularly
Use a plugin like WP Crontrol or Query Monitor’s cron panel to see all events currently scheduled in your WordPress installation. Look for tasks registered by deactivated plugins (which should be cleaned up), events that are overdue, and duplicate schedules. A clean task queue reduces unnecessary server load and prevents conflicts.
2. Use Server Cron for Time-Critical Tasks
For anything that must happen at a specific time — backups, scheduled publishing, automated emails — switch to a real server cron. Work with your host to configure it, or look for a managed hosting environment that runs server-side cron by default. This is a foundational reliability improvement for any WordPress site with meaningful automation.
3. Pair Cron Management with wp-config.php Settings
Configuring WP-Cron behavior is done in wp-config.php. Setting DISABLE_WP_CRON to true is the appropriate step when moving to server-side scheduling, but document what you’ve done and ensure your team knows the cron setup when troubleshooting related issues.
Frequently Asked Questions
Why did my scheduled WordPress post fail to publish on time?
This almost always indicates a WP-Cron timing issue. WP-Cron depends on site traffic to run, so scheduled posts on low-traffic sites often miss their window. Switching to a server-side cron job that runs every few minutes resolves this reliably. You can also manually trigger overdue events with a plugin like WP Crontrol.
How do I know if WP-Cron is working on my site?
Install WP Crontrol from the WordPress plugin repository. It shows you every scheduled task, its hook name, next scheduled time, and whether it’s overdue. An event that should run every hour but is 12 hours overdue is a clear sign WP-Cron isn’t firing correctly.
Does every WordPress plugin use cron?
Not every plugin, but many do. Backup plugins, SEO plugins, caching plugins, WooCommerce, email marketing integrations, and event plugins commonly register their own scheduled tasks. The more plugins you have, the more cron tasks accumulate — and the more important it is that cron is running reliably.
Can a broken cron job slow down my site?
Yes. If tasks pile up in the queue because cron isn’t running, WordPress may try to run many overdue tasks simultaneously when cron does fire — causing a spike in server load. This can cause temporary slowdowns or even server errors on resource-limited hosting environments.
Related Glossary Terms
How CyberOptik Can Help
Understanding how WordPress works under the hood helps you make better decisions about your site. Our team manages WordPress infrastructure — including cron configuration, server-side scheduling, and performance optimization — for clients every day. If you’re dealing with missed schedules, backup failures, or other automation issues, we can diagnose and fix the underlying cause. Get in touch to discuss your project or explore our WordPress hosting solutions.


