Scheduled Tasks and WP-Cron

Learn how WordPress simulates recurring tasks through requests and how to make important jobs more reliable.

4 min read

  • Guide
  • Intermediate
  • 4 minutes read
  • Reviewed August 5, 2026
  • WordPress administration and configuration

WP-Cron is the scheduling system used by WordPress for time-based tasks.

It supports scheduled posts, update checks, cleanup and plugin operations. Unlike a continuously running system scheduler, default WP-Cron is normally checked when WordPress receives requests.

How WP-Cron Works

WordPress stores scheduled events with a timestamp, hook name, optional arguments and recurrence. When a request reaches WordPress, it can check for events that are due and trigger their hooks.

If the site receives no suitable requests, an event may run late.

Common Uses

WP-Cron can publish scheduled content, check for updates, remove expired data, process queues, send reminders, synchronize external data and run plugin cleanup.

Some plugins use their own queue table while using WP-Cron to trigger workers.

Not Exact Real-Time Scheduling

An event becomes due at its timestamp but may execute later if no request triggers the scheduler or if processing is blocked.

Do not treat default WP-Cron as a precision timer for legally or financially critical operations without additional controls.

Low-Traffic and High-Traffic Sites

Low-traffic sites can experience delays. High-traffic sites can create overlapping work if jobs are not designed safely.

A real system scheduler can call WordPress cron at regular intervals.

Replacing Request-Driven Triggering

A common production approach is:

  1. Configure a server scheduler to invoke WordPress cron.
  2. Disable the normal page-load trigger with DISABLE_WP_CRON.
  3. Monitor successful execution.

Do not disable the default trigger before the replacement has been tested.

Duplicate Events

Code should check whether an event is already scheduled. Adding the same recurring hook on every request can create thousands of duplicates.

Time Zones and Timestamps

Custom code should use WordPress date and time APIs instead of mixing server-local, browser and site time without clear conversion rules.

Long-Running Tasks

Large imports, image processing and email batches should be divided into smaller, restartable jobs.

A robust task should be safe to retry, observable, protected against overlap and limited in batch size.

Troubleshooting WP-Cron

  1. Check Site Health.
  2. Inspect scheduled events.
  3. Confirm the hook exists.
  4. Test loopback requests.
  5. Review caching and firewall rules.
  6. Check PHP errors.
  7. Verify the system scheduler.
  8. Review time-zone assumptions.
  9. Check plugin queues and locks.

Frequently Asked Questions

Does WP-Cron run continuously?

No. Default WP-Cron is normally triggered through WordPress requests.

Why was a scheduled post late?

The trigger may not have run, cron may be blocked or processing may have failed.

Should every site use a real system cron?

Not necessarily. It is useful when timing reliability or traffic behavior makes the default unsuitable.

Applying Scheduled Tasks and WP-Cron in a Real WordPress Project

Record the current value, the reason for the change and the expected result. Make important configuration changes in a controlled window, test the affected workflows and document settings that another administrator will need to understand.

A connected concept is WP-Cron and the Heartbeat API. Reading the two together helps separate the immediate task from the wider WordPress responsibility.

A useful implementation begins by writing down the current state, the intended outcome and the evidence that will prove the change worked. This prevents a configuration screen, plugin recommendation or code snippet from becoming the entire strategy.

A Practical Example

Imagine a team making this decision for a production WordPress site. The useful question is not only “Can WordPress do this?” but “Which layer owns it, who maintains it, what data does it affect and how will we verify it after an update?”

Write the answer in operational terms. Name the content, user, setting, file, API or service involved. Then identify what should remain true if the theme changes, a plugin is replaced or the site is migrated.

Questions to Ask

  • What user or system problem does this solve?
  • Which WordPress layer owns the behaviour?
  • What data is created or changed?
  • Who may perform the action?
  • What can fail, and how will that failure be visible?
  • How is the result tested after updates?
  • What is the migration or removal path?

Design Jobs for Repetition and Failure

A scheduled event may run late, more than once or after a previous attempt failed. Use bounded batches, idempotent operations, locks with timeouts and visible retry information.

Monitor queue growth and failed tasks. Moving WP-Cron to a system scheduler improves triggering reliability but does not repair an unsafe job callback.

Official Reference Context

The Plugin Handbook is the primary version-specific reference for this topic. Use the current documentation to verify interface labels, supported APIs and behaviour before applying instructions to a production site.

How to Verify the Result

  • Record the previous setting and the expected change.
  • Test frontend, administration, email, scheduled tasks and affected integrations.
  • Confirm that the configuration is documented for handover and recovery.

Sources and Further Reading

Continue Learning