WordPress cron: disable WP-Cron and use a real cron job instead
· The AYT team · 5 min read

WP-Cron is WordPress's task scheduler: it publishes scheduled posts, checks for updates and runs plugins' tasks. It isn't a real cron, because it only starts when someone opens a page on the site. On a low-traffic site tasks run late; on a busy one the check repeats on every request. The fix is to add define( 'DISABLE_WP_CRON', true ); to wp-config.php and run wp-cron.php from a server cron job every 5 minutes.
What WP-Cron does
On every page load, WordPress checks whether any tasks are due. If so, it sends a request to its own wp-cron.php, which runs them in the background. Among other things, WP-Cron handles:
- publishing scheduled posts;
- checking for and installing automatic updates;
- WooCommerce emails and tasks queued in Action Scheduler;
- backups, clean-ups and imports scheduled by plugins.
When WP-Cron doesn't work well
The most common signs:
- "Missed schedule" next to a post that should have gone out at a set time: nobody visited the site at that moment, so the task started later or not at all.
- Order emails that go out late, on shops with little traffic at night.
- A message under Tools → Site Health: "Your site could not complete a loopback request". WP-Cron needs the server to be able to open its own site; an HTTP password on the whole site, a firewall or a Cloudflare rule can block that request.
- On a staging copy, the same emails sent twice, because the copy runs its tasks too.
To see which tasks exist and whether they're late, install the WP Crontrol plugin. Under Tools → Cron Events it lists every event and its next run, and warns you about the ones that missed their time.
Step 1: disable WP-Cron in wp-config.php
Open wp-config.php (in the File Manager or over FTP) and add this line above the "That's all, stop editing!" comment:
define( 'DISABLE_WP_CRON', true );
From now on, visits no longer start tasks. Until you do step 2, nothing runs at all: no scheduled posts and no automatic updates.
Step 2: set up the cron job in your panel
In your hosting panel (in cPanel the page is called Cron Jobs), add a task with the schedule */5 * * * *, meaning every 5 minutes. The WordPress documentation doesn't prescribe an interval; 5 minutes is the usual compromise, and a shop with many orders can go down to one minute.
The command depends on what your host allows. The web version works almost everywhere:
wget -q -O - "https://yourdomain.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
or, with curl:
curl -s "https://yourdomain.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
If you can run PHP or WP-CLI from cron, that's better: the task no longer goes through the web server, the cache or the firewall, and it isn't cut off by a web request's time limit.
wp cron event run --due-now --path=/home/username/public_html
Replace the domain and the path with your own. The >/dev/null 2>&1 part stops the email cron sends after every run.
Step 3: check that it works
- In WP Crontrol, look at the next-run column: within a few minutes, events that were due should disappear or be rescheduled.
- Schedule a test post 10 minutes ahead and check that it publishes by itself.
- If you run WooCommerce, open WooCommerce → Status → Scheduled Actions and make sure old "Pending" actions don't pile up.
Common mistakes
- You move the site to another host and forget
DISABLE_WP_CRON. The new server has no cron job, so nothing runs. Check this on every move. - One cron job for several sites. Each WordPress site has its own
wp-cron.phpand needs its own task. - WP-Cron left on for staging, so the copy sends real emails to customers. Disable it on the copy and don't add a cron job for it.
- A one-minute interval on a small site. It does no harm, but it starts PHP 1,440 times a day for no reason.
If the loopback request is blocked and you can't set up a real cron, there's the ALTERNATE_WP_CRON constant, which runs tasks through a redirect of the visitor. Use it only until you fix the block.
Frequently asked questions
If I disable WP-Cron, do automatic updates still happen?
Yes, if you have the cron job from step 2. Automatic updates are WP-Cron tasks too; with nothing running wp-cron.php, they stop.
Do I need a real cron on a high-traffic site too?
It's even more useful there. With WP-Cron on, the check happens on every page load; with a real cron, tasks run at fixed times and visitors no longer trigger extra checks.
WP-Cron on AYT hosting
On AYT WordPress hosting you don't have to edit wp-config.php. In the WordPress Toolkit, on the site's Settings tab, switch off "WordPress cron (wp-cron.php)": the panel puts DISABLE_WP_CRON in wp-config.php, and the server runs the due tasks with WP-CLI every 5 minutes (on a Multisite, for every site in the network). The job shows up on the Cron Jobs page, next to the ones you added. Switch it back on and the job goes away.

On staging copies WP-Cron is off from the start, so a copy doesn't run the live site's tasks a second time; if you need it, switch it on from the copy's Staging page. For other scheduled scripts (an import, a product export) you use the same Cron Jobs page. More about test copies is in the guide to the WordPress staging site.
