Background Gradient for Hero Section

WP Cron vs Real Cron – What’s the Difference?

If you’ve ever scheduled a post in WordPress, updated plugins automatically, or used a backup plugin like UpdraftPlus, you’ve interacted with WP-Cron. But what many developers and site owners don’t realize is that WP-Cron isn’t a true cron job, it’s a simulated scheduler that behaves very differently from system-level cron jobs.

Understanding the difference between WP-Cron and a real cron job is critical for performance, reliability, and scalability. Whether you’re running a high-traffic site or maintaining scheduled tasks like publishing content, running reports, or sending emails, choosing the right scheduler can make a big impact on your WordPress site’s stability.

What is WP-Cron?

WP-Cron (wp-cron.php) is WordPress’s built-in pseudo-cron system. It emulates scheduled task execution by checking for any pending events every time a page is loaded. This means tasks aren’t executed based on time alone, they depend on visitors hitting your site.

For example:

  • If a task is scheduled for 12:00 PM but no one visits your site until 12:15 PM, the task won’t run until then.
  • If your site has no traffic for hours, scheduled tasks may not run at all.

This behavior is intentional, it allows WordPress to run on shared hosting environments without shell access. But it comes with trade-offs in timing accuracy and reliability.

Common Use Cases for WP-Cron

  • Publishing scheduled posts
  • Checking for WordPress core/plugin/theme updates
  • Sending scheduled emails or newsletter digests
  • Running plugin-defined scheduled tasks (e.g., WooCommerce, UpdraftPlus, WP Mail SMTP)

What is Real Cron Job?

A real cron job is a scheduled command executed at the system level by the server’s cron daemon. It runs on Unix-like operating systems (Linux, macOS, etc.) and uses crontab configuration to schedule tasks precisely like every minute, hourly, daily, or at custom intervals.

System cron jobs are incredibly reliable because they’re triggered by the operating system itself—not dependent on web traffic or browser activity.

For example, a crontab entry like this:

*/5 * * * * /usr/bin/php /var/www/html/wp-cron.php > /dev/null 2>&1

Runs the WP-Cron handler every 5 minutes, whether or not your site has any visitors.

Key Differences: WP-Cron vs Real Cron

FeatureWP-CronReal Cron Job
Trigger MechanismOn page load (via HTTP request)By server daemon (time-based)
AccuracyDependent on trafficPrecise
Requires TrafficYesNo
Works on Shared HostingYesOften No (unless shell access allowed)
ReliabilityMediumHigh
Setup ComplexityNone (enabled by default)Requires manual setup via crontab
Best ForLow-traffic, simple tasksHigh-traffic or mission-critical tasks

Why WP-Cron Can Be Problematic?

WP-Cron is the task scheduler built into WordPress. It’s responsible for handling automatic actions like checking for plugin updates, publishing scheduled posts, sending email notifications, and running backups. Unlike a real server cron job, which runs at set time intervals regardless of traffic, WP-Cron only fires when someone visits your website.

This design creates several challenges, especially as your site grows or if you run a business-critical site:

1. Unreliable on Low-Traffic Sites

If your website doesn’t get regular visitors, scheduled tasks may run late or not at all. For example, if a post is scheduled to publish at 8 AM but nobody visits until noon, the post won’t go live until that first visit. This can be a problem for businesses or publishers who rely on precise scheduling.

2. Overloaded on High-Traffic Sites

On very busy websites, WP-Cron can run too frequently, sometimes multiple times per minute as each visitor triggers a check. This can waste server resources, cause duplicate tasks, or even slow down your site. High-traffic sites may see performance drops or increased server costs due to this behavior.

3. Missed or Failed Tasks

If something goes wrong like a plugin conflict, PHP error, or strict web hosting settings. WP-Cron tasks can silently fail. You might miss backups, fail to send important emails, or have updates that don’t complete. Because WP-Cron runs in the background, site owners often don’t realize there’s a problem until something breaks.

4. Impacted by Caching and Hosting Restrictions

Some caching plugins or aggressive server-side caching can prevent WP-Cron from running properly, especially if cached pages bypass WordPress loading altogether. Additionally, some managed WordPress hosts or shared hosting environments may restrict WP-Cron or throttle its execution, leading to unpredictable results.

5. Not a True Background Process

Unlike a real cron job, WP-Cron runs as part of the visitor’s page load. This can make pages slower for users if a heavy scheduled task (like a big backup or email send) happens to trigger during their visit.

6. Lack of Granular Control

WP-Cron lacks the advanced scheduling and logging options of a real server cron system. It’s harder to see what’s running, when, and whether a task has failed making it less reliable for mission-critical sites.

How to Disable WP-Cron and Use Real Cron Instead

If you have access to your server’s crontab (typically on VPS, dedicated, or cloud hosting), you can disable WP-Cron and use a real cron job instead. This is a best practice for production sites.

Step 1: Disable WP-Cron in wp-config.php

Add the following line:

define('DISABLE_WP_CRON', true);

This tells WordPress not to trigger WP-Cron on every page load.

Step 2: Add a System Cron Job

Log in to your server and edit the crontab:

crontab -e

Add the following:

*/5 * * * * /usr/bin/php /path-to-your-site/wp-cron.php > /dev/null 2>&1

Replace /path-to-your-site/ with your actual WordPress root path. This will call WP-Cron every 5 minutes regardless of site traffic.

Best Practices for WordPress Cron Management

I have curated some of the best practices that help handle the WordPress Cron more effciently and effectively:

Monitor Cron Events and Logs

Use plugins like WP Crontrol or Advanced Cron Manager to view, edit, and debug scheduled events in your WordPress dashboard. These tools help you spot missed or stuck tasks, add or remove events, and get an overview of what’s happening behind the scenes.

Avoid Scheduling Heavy Tasks During Peak Hours

If you have resource-intensive tasks like sending newsletters or creating large backups. Try to schedule them during off-peak hours when your website has less traffic. This minimizes slowdowns and reduces the risk of timeouts or failed tasks.

Clean Up Unused or Failed Cron Jobs

Sometimes plugins or themes add cron jobs that are never removed, even after the plugin is deactivated. Regularly review your site’s scheduled events to delete anything you no longer need. This keeps your system lean and prevents unnecessary background processes.

Limit Overlapping Cron Events

Make sure long-running tasks aren’t scheduled too frequently, or you may end up with overlapping jobs that slow down your server. Use proper intervals and test the run time of custom tasks to avoid bottlenecks.

Test After Major Changes

Whenever you update plugins, themes, or WordPress core, test to make sure important scheduled tasks (like backups or email notifications) are still running as expected. Sometimes updates can break or change cron functionality.

Stay Informed and Document Your Cron Setup

Keep a record of all custom cron jobs and why they exist. If you manage multiple sites, documenting your cron setup saves time and helps others understand your site’s background processes.

Frequently Asked Questions

Is WP-Cron enabled by default in WordPress?

Yes. WP-Cron is active by default in all WordPress installations. It triggers on every page load to check for scheduled tasks.

Can I run both WP-Cron and a real cron job?

Technically yes, but it’s not recommended. If you use a real cron, you should disable WP-Cron in wp-config.php to avoid duplicate executions.

Is WP-Cron reliable for WooCommerce or LMS sites?

No. For time-sensitive operations like order syncing, enrollment, or license checks, it’s safer to use a real cron job.

What happens if a WP-Cron task fails?

By default, WordPress doesn’t retry failed cron jobs automatically. You’ll need to debug the issue manually or use plugins to monitor failures.

What if I don’t have access to crontab on shared hosting?

You can still rely on WP-Cron, but consider increasing traffic artificially (e.g., via uptime monitors) or using external cron services like EasyCron or Cron-job.org.

Conclusion

WP-Cron is a clever workaround that makes WordPress more accessible to shared hosting environments. But it’s far from perfect. For developers or site owners managing high-traffic or mission-critical websites, relying on WP-Cron alone is a risk.

Switching to a real cron job offers better timing precision, more reliability, and improved server performance. Whether you’re optimizing for scale, uptime, or data integrity, real cron gives you the control WP-Cron simply can’t.

Understanding the difference and knowing when to use is key to building faster, more dependable WordPress websites.

Mehul Gohil
Mehul Gohil

Mehul Gohil is a Full Stack WordPress developer and an active member of the local WordPress community. For the last 13+ years, he has been developing custom WordPress plugins, custom WordPress themes, third-party API integrations, performance optimization, and custom WordPress websites tailored to the client's business needs and goals.

Articles: 164

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Mehul Gohil

Subscribe now to keep reading and get access to the full archive.

Continue reading