Explainers · Explainer
What Is WP-Cron? A Plain Explanation

Short answer
WP-Cron is the built-in task scheduler in WordPress that runs jobs such as publishing scheduled posts at set times. Unlike a real system cron, it uses intervals to simulate a clock and only wakes up when WordPress loads, so tasks can run late on quiet sites. Plugins schedule tasks with wp_schedule_event(), and a real server cron job can replace it when exact timing matters.
Key takeaways
- WP-Cron simulates a system cron with intervals, and only runs when WordPress loads a page.
- WordPress ships with four intervals: hourly, twicedaily, daily, and weekly, with weekly added in WordPress 5.4.
- wp_schedule_event() needs a first run time, an interval name, and a hook name.
- Always guard scheduling with wp_next_scheduled() so the same event is not registered thousands of times.
- Setting DISABLE_WP_CRON to true turns WP-Cron off, and a server cron job must replace it.
- Scheduled events live in the database, so they survive after a plugin is deactivated.
What is WP-Cron?
WP-Cron is the built-in task scheduler in WordPress that runs jobs such as publishing scheduled posts at set times.
WP-Cron is not a real system cron. The Plugin Handbook at Developer.WordPress.org says WP-Cron uses intervals to simulate a system cron, rather than scheduling tasks for exact clock times. Understanding WP-Cron Scheduling It keeps a list of scheduled events and runs each one when its time comes.
The name confuses many site owners, because WP-Cron behaves differently from the cron daemon on a Linux server. A system cron runs on a clock, even when nobody visits the site. WP-Cron only wakes up when WordPress loads, so its timing depends on site traffic.
How does WP-Cron work?
WP-Cron checks the list of scheduled events each time WordPress loads a page, and runs any task whose time has passed.
When a visit finds a due task, WordPress starts a separate background request so the visitor does not wait for the task to finish. That request runs the task, then ends. If no task is due, nothing extra happens.
This design has one clear result: a quiet site runs its tasks late. If nobody visits for hours, a post set to publish at 9 in the morning may not go out until the first visitor arrives after 9. On a busy site, the opposite happens, and WP-Cron checks the list on every page load.
The list of events lives in the database, not in your code. That is why a scheduled task can keep running after the plugin that created it is turned off, as the Plugin Handbook warns.
What tasks does WP-Cron run?
WP-Cron runs scheduled posts, routine maintenance jobs from WordPress itself, and any recurring task a plugin or theme has registered.
The best-known job is publishing scheduled posts. When you set a post to publish later, WordPress registers an event for that time, and WP-Cron publishes it when the time arrives. If the post stays in “Scheduled” past its time, WP-Cron is the first place to look. How to fix missed scheduled posts
Plugins use the same system for their own jobs. A backup plugin may run a nightly backup, a form plugin may send a daily summary, and a shop plugin may clean up old carts. Each of these is just an event with a hook name, a first run time, and a repeat interval.
WordPress itself also uses WP-Cron for routine work such as checking for updates and clearing out old data. You never see these jobs, but they are part of why a site stays current without you doing anything.
What are the default WP-Cron schedules?
WordPress ships with four built-in intervals: hourly, twicedaily, daily, and weekly.
The Plugin Handbook lists the four default intervals, and notes that weekly has existed since WordPress 5.4. All intervals are measured in seconds.
| Interval | Seconds | How often it runs |
|---|---|---|
| hourly | 3600 | Once an hour |
| twicedaily | 43200 | Every 12 hours |
| daily | 86400 | Once a day |
| weekly | 604800 | Once a week |
These four cover most needs. If you need a different gap, such as every 15 minutes, you register a custom interval first, then schedule the event with it. A custom interval is just a name, a length in seconds, and a label for the admin screens.
Note that the interval is a gap between runs, not a clock time. A daily event set to start at 2 in the afternoon runs again at 2 the next afternoon, but only when a visit triggers it, so the real time can drift later on a quiet site.
How do plugins schedule tasks with WP-Cron?
A plugin schedules a task with wp_schedule_event(), giving it a first run time, a repeat interval, and the name of a hook to fire.
The Plugin Handbook explains that wp_schedule_event() takes three required values: $timestamp, the Unix timestamp of the first run; $recurrence, the name of the interval; and $hook, the name of the custom hook to call. An optional fourth value passes extra data to the task.
Before scheduling, the code must check whether the event already exists. The handbook gives this guard:
if ( ! wp_next_scheduled( 'bl_cron_hook' ) ) {
wp_schedule_event( time(), 'five_seconds', 'bl_cron_hook' );
}
wp_next_scheduled() takes the hook name and returns the timestamp of the next run, or false when the event is not scheduled.
Without that check, calling wp_schedule_event() on every page load would register the same event again and again, and the handbook warns that a task could end up scheduled several thousand times.
The hook itself does the work. The plugin registers a function on the hook name with add_action(), and WordPress calls that function each time the event fires.
How do you add a custom WP-Cron interval?
You add a custom interval with the cron_schedules filter, giving it a name, a length in seconds, and a display label.
The Plugin Handbook shows an example that adds a five-second interval:
add_filter( 'cron_schedules', 'example_add_cron_interval' );
function example_add_cron_interval( $schedules ) {
$schedules['five_seconds'] = array(
'interval' => 5,
'display' => esc_html__( 'Every Five Seconds' ), );
return $schedules;
}
The filter hands you the array of existing intervals, and you return it with your addition merged in. The handbook notes that all intervals are in seconds, so a 15-minute interval uses 900, and an interval of one hour uses 3600.
Register the filter before you schedule an event that uses it, or WordPress will reject the event. Once the interval exists, you pass its name as the recurrence to wp_schedule_event(), just like a built-in interval.
Why do scheduled posts sometimes publish late?
Scheduled posts publish late when no visit triggers WP-Cron at the set time, because WP-Cron only runs when WordPress loads.
A site with steady traffic rarely has this problem, since visits arrive all day. A quiet site, a site behind heavy page caching, or a site where the cron request is blocked can miss the time by hours.
The wp-config.php handbook notes that an alternative cron is most often set up when scheduled posts are not getting published as predicted. Editing wp-config.php
Caching can also hide the problem. A cached page may load without running WordPress at all, so no check happens.
If missed schedules keep happening, check whether your host or a plugin blocks the background request to wp-cron.php, and check the Site Health screen for the loopback and REST API problems described in this guide to fixing Site Health REST API errors.
The fix for a site that must publish on time is a real server cron job, covered in the next section. That job calls wp-cron.php on a clock, so the site no longer waits for a visitor.
How do you replace WP-Cron with a real server cron job?
You turn WP-Cron off in wp-config.php with DISABLE_WP_CRON, then add a server cron job that calls wp-cron.php on a fixed schedule.
First, add this line above the “That's all, stop editing!” comment in wp-config.php:
define( 'DISABLE_WP_CRON', true );
The developer handbook gives exactly this line for turning cron off. With it set, visits no longer trigger scheduled tasks, so you must replace them with a server job, or nothing will run at all.
Second, add a cron job in your host panel that visits wp-cron.php every 15 minutes. A typical entry looks like this:
*/15 * * * * curl -s https://example.com/wp-cron.php?doing_wp_cron > /dev/null
Use your own domain in place of example.com. The ?doing_wp_cron part marks the request as a cron run. Every 15 minutes is a common choice, since it keeps delays short without loading the server.
If your host panel has no cron section, ask the host to add the job for you, or use an outside uptime monitor that loads wp-cron.php on a schedule. Either way, test it by scheduling a post a few minutes ahead and watching it publish on time.
How do you check which WP-Cron events are scheduled?
You check scheduled events with WP Crontrol, a free plugin from WordPress.org that lists every event, its hook name, and its next run time.
Install WP Crontrol and open the Cron, then Cron Events menu. The list shows every scheduled event with its arguments, schedule, callback functions, and when it is next due, and the plugin warns you about events that missed their schedule. WP Crontrol documentation
If an event is missing, the plugin or code that should have scheduled it never ran, or it was removed. If the next run time is far in the past, the event is due but has not fired, which points to WP-Cron not running at all. How to fix WP-Cron not running
A developer can also list events from the server with WP-CLI, the command-line tool for WordPress. Its cron commands are part of WP-CLI itself, and wp help cron shows what they do, according to the WP Crontrol plugin page. Either method shows the same list, so use whichever fits your setup.
What mistakes should you avoid with WP-Cron?
The mistakes to avoid are scheduling the same event twice, leaving dead events behind, and treating WP-Cron as a clock.
- Scheduling without a guard. Always check
wp_next_scheduled()before callingwp_schedule_event(), or the event can be registered thousands of times. - Forgetting to unschedule. When a task is no longer needed, remove it with
wp_unschedule_event(), which takes the timestamp and the hook name and removes that run and all future runs. The Plugin Handbook says to do this when a plugin is deactivated, usingregister_deactivation_hook(). - Expecting exact times. WP-Cron runs tasks late on quiet sites, so never use it for anything that must happen at a precise minute. Use a real server cron job for that.
- Turning WP-Cron off without a replacement. Setting DISABLE_WP_CRON to true stops all scheduled work, so add the server job in the same session.
- Running very short intervals on a busy site. A task every minute adds a background request on every visit, which can load the server for little gain. Match the interval to how fresh the result needs to be.
Frequently asked questions
Do I need to set up WP-Cron myself?
No. WP-Cron is built into WordPress and runs by itself. You only need to think about it when scheduled posts publish late, a plugin task does not run, or you want exact timing. For most small sites with steady traffic, the default setup works without any changes.
Why did my scheduled post publish hours late?
It runs late because WP-Cron only wakes up when someone visits the site. If no visit arrives at the set time, the post waits for the next visitor. A real server cron job that calls wp-cron.php every 15 minutes fixes this, because it runs on a clock instead of waiting for traffic.
How do I switch WP-Cron to a real server cron job?
Add define( 'DISABLE_WP_CRON', true ); to wp-config.php, then add a server cron job that loads wp-cron.php on a schedule, such as every 15 minutes. Do not turn it off without adding the server job, or no scheduled task will run at all.
Why is the same WP-Cron event listed many times?
A plugin or theme can schedule the same event many times if it calls wp_schedule_event() on every page load without checking first. The fix is to guard the call with wp_next_scheduled(), which returns false only when the event is not already scheduled.
Does deactivating a plugin remove its scheduled tasks?
Yes. Events live in the database, so deactivating a plugin does not remove them. The plugin should remove its events when it is deactivated, using register_deactivation_hook(). If it does not, you can remove the dead event with wp_unschedule_event() or a cron viewer plugin.
Sources
- Understanding WP-Cron Scheduling Developer.WordPress.org
- Scheduling WP Cron Events Developer.WordPress.org
- wp_schedule_event() function reference Developer.WordPress.org
- Editing wp-config.php Developer.WordPress.org
- WP Crontrol plugin WordPress.org
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


