⚡ WordPress · Client-side · No data sent to server

WP-Cron Explainer

Pick a WordPress schedule and get the human meaning plus ready-to-paste wp_schedule_event code. See how WP-Cron differs from a real system cron and how to switch. Everything runs in your browser.

Schedule
Hook
Schedule the event
 

WP-Cron is not a real cron

WP-Cron does not watch the clock. WordPress checks for due tasks on each page request. On a quiet site with no visits, due tasks wait until the next request, so timing drifts. A real system cron runs on a fixed interval regardless of traffic.

Switch to a real system cron

1. Stop WordPress from triggering cron on page loads. Add this to wp-config.php:

wp-config.php
define( 'DISABLE_WP_CRON', true );

2. Add a crontab line that requests wp-cron.php on a fixed interval (here, every 5 minutes):

crontab -e
*/5 * * * * wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Copied to clipboard
100% private. This tool builds every explanation and code snippet in your browser. Nothing you select or type is uploaded or logged.

About the WP-Cron Explainer

The WP-Cron Explainer shows what WordPress's built-in scheduling system actually does and gives you ready-to-paste PHP for it. Pick a schedule (hourly, twicedaily, daily, weekly, or a custom interval in seconds) to see its plain-English meaning and the wp_schedule_event() code, including how to register a custom interval with the cron_schedules filter. It also explains how WP-Cron differs from a real system cron and shows the exact steps to switch to one. Everything runs in your browser; nothing is sent to a server.

How it works

  1. Pick one of the built-in schedules, or choose Custom and enter an interval in seconds.
  2. Read the plain-English meaning and the matching wp_schedule_event() snippet.
  3. For a custom interval, copy the cron_schedules filter that registers your slug, then the scheduling code.
  4. Read the WP-Cron vs system cron section and copy the DISABLE_WP_CRON and crontab lines if you want a real cron.

Features

  • Built-in schedules covered: hourly, twicedaily, daily, weekly.
  • Custom interval in seconds, with a generated cron_schedules registration snippet.
  • Ready-to-copy wp_schedule_event(), wp_next_scheduled(), and wp_unschedule_event() code.
  • Clear explanation of why WP-Cron is request-triggered, not time-accurate.
  • Copy-paste DISABLE_WP_CRON constant and crontab line to run a real system cron.

Frequently asked questions

What is WP-Cron?

WP-Cron is WordPress's task scheduler. It runs scheduled jobs such as publishing future posts, checking for updates, and plugin tasks. Unlike a system cron, it is not driven by the server clock; it checks for due tasks when someone visits the site.

Why didn't my scheduled task run on time?

WP-Cron only fires when a page is requested. On a low-traffic site, if no one visits, due tasks wait until the next visit. That is why 'hourly' can drift on quiet sites. Switching to a real system cron makes timing reliable.

How do I add a custom schedule interval?

WordPress ships with hourly, twicedaily, daily, and weekly. To add your own, hook the cron_schedules filter and add an entry with an 'interval' in seconds and a 'display' label, then pass your slug to wp_schedule_event(). This tool generates that code for you.

How do I switch WP-Cron to a real system cron?

Add define('DISABLE_WP_CRON', true); to wp-config.php so WordPress stops triggering cron on page loads. Then add a crontab line that requests wp-cron.php on a fixed interval, for example every 5 minutes. The tool shows both lines to copy.

Is anything sent to a server?

No. The tool builds all explanations and code snippets in your browser. Nothing you select or type leaves your device.