Skip to content
hostcomplex

What Is WP-Cron

Maarten Soetens 2 min read

How WP-Cron Schedules Tasks Inside WordPress

What is WP-Cron? WP-Cron is WordPress’s built-in task scheduler. It runs jobs at set times, such as publishing a scheduled post, checking for updates, clearing caches or sending a planned email. Despite its name, it is not a real cron job: it is code inside WordPress, not a service run by the server’s operating system.

WP-Cron keeps its list of scheduled events in the database, in the options table described in the database tables article. Each event records when it should run and which function to call.

Why Visits Trigger Scheduled Tasks

WordPress has no background process of its own, so WP-Cron checks for due tasks when a page is requested. If a task is due, WordPress runs it, usually by sending a short background request to itself. A task therefore runs at the first visit after its scheduled time, not at the exact moment.

Consider a scheduled post set for 9:00. On a busy site with many visits, it appears at about 9:00. On a quiet site where the first visitor arrives at noon, the post is published at noon.

Why Low and High Traffic Cause Problems

On a site with few visitors, scheduled tasks run late or not at all. This affects time-sensitive work such as scheduled posts, backups set up in plugins and reminder emails.

A very busy site has the opposite problem. Many visitors can trigger the check repeatedly, adding load to the server, and long-running tasks can overlap. Many site owners therefore replace WP-Cron with a real server scheduler, which runs at fixed intervals no matter how much traffic arrives. Update checks are one example of the jobs involved, as explained in the updates article.

Frequently asked questions

Is WP-Cron the same as a cron job?

No. A cron job is scheduled by the server’s operating system and runs at fixed times whether or not anyone visits the site. WP-Cron runs only when WordPress is loaded, so its timing depends on traffic.

Can WP-Cron be turned off?

Yes. It can be disabled with a constant in wp-config.php, such as DISABLE_WP_CRON, and many sites do so when they run a server scheduler instead. Disabling it without a replacement stops scheduled posts, update checks and plugin jobs from running.

  • Two-Factor Authentication

    Two factor authentication hosting adds a second check to control panel, domain and CMS logins. Learn which methods are strongest and why 2FA helps.

  • What Is an A Record?

    What is an A record? Learn how this DNS record maps a hostname to an IPv4 address, why domains use several A records and the root and www pattern.

  • Billing and Automation Platforms

    What is WHMCS? Learn how this commercial billing and automation platform helps hosts sell plans, collect payments and create accounts automatically.