EN · $ USD
WordPress and E-commerce

How to Disable WP-Cron and Set Up a Real Cron Job

7 min read Updated: Sunucu Atlas technical team

In short

To disable WP-Cron, add define( 'DISABLE_WP_CRON', true ); to wp-config.php, then create a job in cPanel Cron Jobs that runs wp-cron.php with PHP every 5 minutes. Scheduled tasks then run on a regular, predictable schedule regardless of visitor traffic, and page loads no longer carry the cron overhead.

In this guide
  1. How WP-Cron Works and Why It Causes Problems
  2. Who Should Switch to a Real Cron Job?
  3. Step 1: Disable WP-Cron in wp-config.php
  4. Step 2: Create a Real Cron Job in cPanel
  5. Step 3: Verify It's Working
  6. A Note on WooCommerce and Action Scheduler
  7. If You Have More Than One WordPress Site
  8. Common Mistakes
  9. Next Step

WP-Cron is the built-in system WordPress uses to run scheduled tasks (scheduled posts, plugin update checks, backups, WooCommerce canceling unpaid pending orders and so on). Despite the name, it's not a real server scheduler: it only fires when someone visits your site. So on low-traffic sites tasks get missed, and on high-traffic sites it adds unnecessary load. The fix is simple: turn off visitor-triggered WP-Cron and run wp-cron.php at regular intervals with a real cron job in cPanel.

How WP-Cron Works and Why It Causes Problems

On every page request, WordPress checks whether any task is due. If one is, it sends a background HTTP request (loopback) to its own server at wp-cron.php, and the tasks run in that request. This design was chosen so it works on any host without setup, but it has three clear problems:

  • No visitors, no tasks: A post scheduled for 3:00 AM waits for the first visitor if nobody comes to the site at that time. WordPress shows this as "Missed schedule".
  • More traffic, more wasted load: On busy sites the check runs on every request; a heavy task (backup, large import, image optimization) starts alongside a visitor's request and can slow down page responses at that moment.
  • If loopback is blocked, it never runs: When the site can't send requests to itself (firewall rule, directory password, broken SSL, maintenance mode), all scheduled tasks silently stop. "Loopback request failed" or "scheduled event has failed" warnings on the Site Health screen are the sign.

A real cron, by contrast, is the server operating system's scheduler and runs at the interval you set, with or without traffic.

Who Should Switch to a Real Cron Job?

Site typeIs WP-Cron enough?Recommendation
Low-traffic blog or brochure siteScheduled posts may be missedReal cron, every 15 minutes
Medium-traffic business siteUsually works, adds overheadReal cron, every 5 minutes
WooCommerce storeOrder and stock tasks can be delayedReal cron, every 1 to 5 minutes
Membership, subscription or newsletter sitePayment and sending timing is criticalReal cron, every 1 to 5 minutes

These intervals are guidelines; adjust them to how often your tasks are scheduled.

Step 1: Disable WP-Cron in wp-config.php

Open the wp-config.php file in the site's root directory with cPanel File Manager or FTP. Add this above the /* That's all, stop editing! */ line:

define( 'DISABLE_WP_CRON', true );

This line only turns off visitor-triggered runs; wp-cron.php keeps working and the server cron will now call it. Adding the line and skipping step 2 means every scheduled task on the site stops, so always do both steps together.

Step 2: Create a Real Cron Job in cPanel

  1. In cPanel, open the Cron Jobs tool in the Advanced section.
  2. Leave the Cron Email field set to your own address for now; it helps you see whether the first run throws an error.
  3. From the Common Settings list, choose Once Per Five Minutes (*/5 * * * *).
  4. Enter one of the commands below in the Command field and save with Add New Cron Job.

Recommended: run it directly with PHP CLI

cd /home/KULLANICIADI/public_html && /usr/local/bin/php -q wp-cron.php >/dev/null 2>&1

Replace KULLANICIADI with your cPanel username; if the site is an addon domain or in a subfolder, change the path to that folder. Because this method doesn't go through HTTP, it isn't affected by SSL, firewall or directory password problems. /usr/local/bin/php runs the server's default PHP version; if you want it to match the version your site uses, you can use the EasyApache path, for example /opt/cpanel/ea-php82/root/usr/bin/php (pick the version number for your own site).

Alternative: trigger it with an HTTP request

wget -q -O /dev/null 'https://alanadiniz.com/wp-cron.php?doing_wp_cron' >/dev/null 2>&1

This method calls the site like a visitor would. If the site sits behind caching, a CDN or password protection, the request may never reach the tasks, so use it as a second choice.

Alternative: run it with WP-CLI

If WP-CLI is installed on your account, you can also use this command to run only the events that are due:

cd /home/KULLANICIADI/public_html && wp cron event run --due-now >/dev/null 2>&1

The full path to WP-CLI may vary by server; check it over SSH with which wp. For more details on the cPanel cron interface, see the setting up a cron job in cPanel guide.

The >/dev/null 2>&1 at the end of the commands discards the output, so you don't get an email on every run. If you want to see errors during your first test, remove that part temporarily.

Step 3: Verify It's Working

After setup, wait at least one cycle and check the following:

  1. Site Health: On the Tools > Site Health screen, there should be no warnings about scheduled events.
  2. WP Crontrol: With this free plugin, check the Tools > Cron Events list to make sure overdue events aren't piling up in the "Next Run" column.
  3. WooCommerce: On the WooCommerce > Status > Scheduled Actions tab, actions in "Pending" status shouldn't pile up past their due time.
  4. Test post: Schedule a draft 10 minutes out and watch whether it publishes on time.

If you have SSH access, you can also view the event list directly:

wp cron event list --fields=hook,next_run_relative
wp cron test

A Note on WooCommerce and Action Scheduler

WooCommerce runs heavy jobs through a queue system called Action Scheduler: canceling unpaid orders, sending webhooks, reporting and many integration tasks live in this queue. Action Scheduler uses WP-Cron to process the queue. When you switch to a real cron, the queue is processed at the interval you set, so on stores with lots of orders, moving the interval closer to 1 minute keeps the queue from backing up. For other causes of slowdowns as product count and order volume grow, read the WooCommerce speed optimization guide.

If You Have More Than One WordPress Site

If you have several WordPress sites in the same hosting account as addon domains or subdomains, each one needs its own cron job; one site's cron doesn't run another site's tasks. A sample setup looks like this:

*/5 * * * * cd /home/KULLANICIADI/public_html && /usr/local/bin/php -q wp-cron.php >/dev/null 2>&1
*/15 * * * * cd /home/KULLANICIADI/ikincisite.com && /usr/local/bin/php -q wp-cron.php >/dev/null 2>&1

The first two fields are minute and hour, and the next three are day of month, month and day of week; the cPanel interface shows these fields in separate boxes. Instead of putting every job on the same minute, vary the intervals and start minutes; for example, running one site with */5 and another with 2-59/15 keeps PHP processes from piling up at the same moment. Remember to add the DISABLE_WP_CRON line to each site's wp-config.php separately.

Common Mistakes

  • Adding the same line twice: If DISABLE_WP_CRON is already defined in wp-config.php, a second definition triggers a warning; search the file and keep a single line.
  • Adding the line in the wrong place: Definitions added below the "stop editing" line are read after WordPress loads, so they have no effect.
  • Running it too often: A cron that runs every minute starts needless PHP processes on a small site with few tasks.
  • Forgetting the staging copy: If you added a separate cron for a test site, remove that cron job when you delete staging.
  • Wrong directory path: If the cd path in the command doesn't lead to the site's actual document root, PHP can't find wp-cron.php and tasks never run. Copy the path from the address bar in cPanel File Manager, and on your first test remove the output redirect to check the resulting email for errors.
  • Confusing it with ALTERNATE_WP_CRON: This constant is an old workaround that tries to get around loopback problems with a redirect; you don't need it once you set up a real cron.

Next Step

Setting up a real cron takes only a few minutes, but it makes your site's background jobs independent of visitor traffic. To do it, your hosting must let you define cron jobs and have enough resources to run PHP processes comfortably. Sunucu Atlas WordPress hosting plans come with WP Toolkit and LiteSpeed Web, so you can easily set up a regular cron for scheduled posts and plugin tasks. If you run a store where order, stock and payment tasks have to run on time, check out our e-commerce hosting plans, which come with WordPress and WooCommerce preinstalled and offer higher RAM and CPU limits. If you're not sure which plan fits your traffic, compare e-commerce hosting options or browse WordPress hosting plans.

Frequently asked questions

Is it safe to disable WP-Cron?

Yes, as long as you set up a real server-side cron job to replace it, and tasks will run more reliably. If you only disable it without setting up a real cron, all scheduled tasks stop.

What causes the 'Missed schedule' error in WordPress?

WP-Cron only fires when someone visits the site, so if there are no visitors at the scheduled time or the loopback request is blocked, the task doesn't run. Setting up a real cron job eliminates the problem.

How often should the cron job run?

Every 5 minutes is enough for most sites. As a guideline, use 15 minutes for low-traffic blogs and 1 to 5 minutes for busy WooCommerce stores.

Should I use wget or PHP CLI?

PHP CLI is recommended because it doesn't go through HTTP and isn't affected by obstacles such as SSL, caching, firewalls or directory passwords. The wget method is an alternative when you don't know the PHP path.

I get an email every time the cron job runs. How do I stop it?

Add >/dev/null 2>&1 to the end of the command, or clear the Cron Email field on the cPanel Cron Jobs screen. The output is discarded and no email is sent.

For this guide

Recommended plans

If you want scheduled posts, order cancellations and stock tasks to run without waiting for visitors, WordPress or e-commerce hosting that lets you define cron jobs and has the resources to handle WooCommerce's background queue is the right foundation.

SA-WP-1

cPanel
Recommended

20 GB NVMe disk

$0.39/mo

+VAT

  • Processor1 cores
  • Memory1 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 50 GB Traffic
  • 5 Email Account Limit

SA-WP-2

cPanel

40 GB NVMe disk

$0.69/mo

+VAT

  • Processor2 cores
  • Memory2 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 100 GB Traffic
  • 10 Email Account Limit

SA-WP-3

cPanel

60 GB NVMe disk

$0.98/mo

+VAT

  • Processor3 cores
  • Memory3 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 200 GB Traffic
  • 25 Email Account Limit

WordPress Hosting — tüm paketler E-Commerce Hosting — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.