WordPress Cron Expression Generator

Build and explain cron expressions, preview the next run times, replace WP-Cron with a real server cron job and generate wp_schedule_event() PHP.

Runs in your browser
Tool

Cron expression

Five fields: minute hour day-of-month month day-of-week. Supports *, lists (1,15), ranges (9-17), steps (*/5, 0-30/10), names (MON-FRI, JAN) and @hourly, @daily, @weekly, @monthly, @yearly.

0–59

0–23

1–31

1–12 or JAN–DEC

0–7 or SUN–SAT

Schedule

Every 15 minutes.

Replace WP-Cron with a real cron job

WP-Cron only runs when someone visits the site. A server cron job runs it on time even with no traffic, and removes the check from every page load. Use the expression on the left (every 5–15 minutes is typical).

Folder containing wp-config.php.

1. wp-config.php

// Disable the WP-Cron check on page loads; a real server cron job runs it instead.
define( 'DISABLE_WP_CRON', true );

2. crontab -e (choose one line)

# Option 1 — wget
*/15 * * * * wget -q -O - "https://example.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1

# Option 2 — curl
*/15 * * * * curl -fsS "https://example.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1

# Option 3 — WP-CLI (no HTTP request, no PHP timeout; run as the site owner, not root)
*/15 * * * * wp cron event run --due-now --path=/var/www/html --quiet >/dev/null 2>&1
Add DISABLE_WP_CRON above the “That’s all, stop editing!” line. In cPanel use Cron Jobs, in Plesk Scheduled Tasks. On multisite, the HTTP options only run the main site’s queue — run WP-CLI per site with --url=.

How does cron work in WordPress?

On a server, cron runs commands on a schedule described by a five-field expression: minute, hour, day of month, month and day of week. */15 * * * * means “every 15 minutes”, 0 3 * * 1-5 means “03:00 on weekdays”. Fields accept lists (1,15), ranges (9-17), steps (*/5), month and weekday names, and shortcuts such as @daily.

WordPress has its own scheduler, WP-Cron, which plugins use for publishing scheduled posts, checking for updates, sending emails and clean-up tasks. It is not a real cron: on each page load WordPress checks whether an event is due and, if so, fires a background request to wp-cron.php. On low-traffic sites events run late; on busy sites the check adds overhead to every request. The standard fix is to set DISABLE_WP_CRON and let a server cron job call WP-Cron every few minutes.

This tool covers both sides: a cron expression builder with a validator, plain-English description and the next five run times; the exact crontab lines (wget, curl or WP-CLI) to run WP-Cron reliably; and a generator for the PHP that schedules your own recurring event with wp_schedule_event(), including custom intervals via the cron_schedules filter.

How to use the WordPress Cron Expression Generator

  1. In Cron expression & server cron, pick a preset or type an expression; edit individual fields if you prefer. The description and next run times update as you type.
  2. Enter your site URL and WordPress path to get the crontab lines, add DISABLE_WP_CRON to wp-config.php and add one of the lines with crontab -e or your hosting panel.
  3. Switch to WP-Cron PHP event to schedule your own task: name the hook and callback, choose a recurrence or a custom interval and when the first run should happen.
  4. Choose plugin mode (activation/deactivation hooks) or theme mode (scheduled on init, cleared on theme switch), copy the PHP and test it with wp cron event run.

Example

Running WP-Cron every 5 minutes from the server instead of on page loads:

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

# crontab -e
*/5 * * * * wget -q -O - "https://example.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1

Cron syntax cheat sheet

  • * — every value; */n — every n-th value (*/10 in the minute field = every 10 minutes).
  • a-b — a range; a-b/n — every n-th value in the range; a/n — from a to the maximum, every n.
  • a,b,c — a list, e.g. 0,30 for on the hour and half past.
  • Day of week: 0 or 7 is Sunday; names SUN–SAT and months JAN–DEC are accepted.
  • When both day-of-month and day-of-week are restricted, cron runs when either matches: 0 0 1 * 1 runs on the 1st and on every Monday.

WP-Cron best practices

  • Always check wp_next_scheduled() before wp_schedule_event(), or you will add a duplicate event on every page load.
  • Clear your events with wp_clear_scheduled_hook() on deactivation so orphaned events do not run forever.
  • Keep callbacks short or process work in batches — long tasks hit PHP time limits. For heavy queues, consider Action Scheduler.
  • Need to convert a run time? The Unix Timestamp Converter turns wp cron event list timestamps into dates.

Frequently Asked Questions

Is it safe to disable WP-Cron?

Yes, as long as a server cron job calls it instead. DISABLE_WP_CRON only stops the check on page loads; events still run whenever wp-cron.php is requested or wp cron event run --due-now is executed. Without a replacement, scheduled posts and updates stop working.

Should I use wget, curl or WP-CLI?

WP-CLI is the most robust: it runs PHP directly, so there is no HTTP request, no web server timeout and no issue with caching or firewalls. Use wget or curl when WP-CLI is not installed, which is common on shared hosting.

How often should the server cron run?

Every 5 minutes suits most sites; every 15 minutes is fine for brochure sites. WP-Cron cannot run events more often than the server job triggers it, so use a shorter interval if you schedule frequent custom events.

Why does my scheduled event never run?

Common causes: the event was scheduled in an activation hook that never ran (code added to an active plugin), a custom schedule name that is not registered, DISABLE_WP_CRON set without a server cron, or a loopback request blocked by the host. wp cron event list and wp cron test show which.

Are cron times in UTC?

Server cron uses the server’s time zone, which is often UTC. WP-Cron stores timestamps in UTC; the generated PHP uses wp_timezone() so a “03:00” first run follows the time zone set in Settings → General.