WP Cron Simulator & Viewer
Visually understand how WordPress scheduled tasks (WP-Cron) execute. Add events, simulate page loads, and learn how to optimize your server cron jobs.
Schedule New Hook
Real Server Cron Config
If you disabled WP-Cron, add this command to your cPanel or server cron jobs to run every 5 minutes:
WP-Cron Event Queue
| Hook Name | Schedule | Next Run In | Status | Actions |
|---|
Execution Timeline (Log)
Understanding WP-Cron: The Complete WordPress Cron Job Guide
Whether you are a developer writing custom plugins or a site owner trying to figure out why your scheduled posts keep failing, understanding how WordPress handles time-based tasks is critical. Our WP Cron Simulator & Viewer provides a visual, real-time representation of the WP-Cron queue, helping you demystify the inner workings of WordPress task scheduling.
What is WP-Cron and How Does it Work?
In traditional server environments (like Linux), a "Cron Job" is a demon that runs continuously in the background and executes tasks at specific times based on the system clock. WordPress, however, was designed to be universally compatible with almost any hosting provider, many of which did not traditionally allow users to access the server's crontab.
To solve this, WordPress created WP-Cron (wp-cron.php). WP-Cron is what developers call a "Pseudo-Cron" system. It does not run continuously in the background. Instead, it relies on website traffic.
Here is the exact flow of WP-Cron:
- A visitor lands on any page of your WordPress website.
- During the page load, WordPress checks the database (specifically the
cronarray in thewp_optionstable) to see if any scheduled tasks have a timestamp that is in the past (overdue). - If it finds an overdue task, WordPress spawns an asynchronous HTTP request back to itself calling
wp-cron.phpto execute those tasks in the background.
The Problem with WP-Cron (Performance & Reliability)
While the pseudo-cron system is ingenious for compatibility, it introduces two massive problems for modern websites:
1. Low Traffic = Missed Events
If you schedule a backup to run at 3:00 AM, but nobody visits your website until 8:00 AM, your backup will not trigger until 8:00 AM. This makes WP-Cron highly unreliable for time-sensitive operations like publishing scheduled posts, sending email newsletters, or processing subscription renewals (like WooCommerce Subscriptions).
2. High Traffic = Server Overload
Conversely, if your site gets hit by a massive spike in traffic (e.g., a viral article), WordPress is forced to check the cron queue hundreds of times per second. Even though it utilizes locking mechanisms, the overhead of constantly checking and spawning processes can degrade your server's performance and slow down the Time to First Byte (TTFB) for your visitors.
How to Fix WP-Cron: Using Real Server Cron
To achieve enterprise-level performance and reliability, WordPress developers universally recommend disabling the pseudo-cron system and triggering it directly from the server. This is a two-step process:
Step 1: Disable Default WP-Cron
Open your wp-config.php file and add the following line before the "That's all, stop editing!" comment:
(You can test the effect of this setting using the toggle in our Simulator above. Notice how page loads stop triggering overdue events!)
Step 2: Add a Server-Side Cron Job
Log into your hosting control panel (cPanel, Plesk, or SSH) and add a real cron job to hit the wp-cron.php file at a fixed interval (usually every 5 to 15 minutes). A common wget command looks like this:
Common Default WordPress Cron Hooks
When you look at your event queue, you will likely see a multitude of tasks created by the WordPress core itself. Here are a few essential hooks you should recognize:
- wp_version_check: Contacts WordPress.org twice a day to check if a new core update is available.
- wp_update_plugins & wp_update_themes: Similar to version check, but scans your installed extensions for available updates.
- publish_future_post: The hook responsible for taking a post out of the "Scheduled" status and publishing it to the public.
- wp_scheduled_delete: Permanently deletes posts and comments that have been sitting in the Trash folder for more than 30 days (controlled by
EMPTY_TRASH_DAYS).
Using This Simulator Tool
Our WP Cron Job Viewer tool provides a perfect sandbox to experiment with scheduling. You can add Custom Intervals, push the simulated time forward to instantly make tasks "overdue," and simulate page loads to watch the queue clear itself. It is the perfect educational tool for mastering WordPress background processing without risking your live database!
PluginLib