Skip to content

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

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

To disable WP Cron, add one line to wp-config.php and replace it with a real cron job. The line stops WordPress from checking for tasks on every page load. The real job then runs those tasks on a clock you control.

We tested the setup on a WordPress 7.1 site with WooCommerce 11.2 in October 2026. We watched overdue tasks stay overdue after the switch. We then cleared them with WP-CLI and with a plain request to wp-cron.php.

This guide covers how WP Cron works, when to turn it off and three ways to replace it. It also shows the right run interval, what changes for WooCommerce stores and how to check that everything still runs.

What Is WP Cron and How Does It Work?

WP Cron is WordPress’s built-in task scheduler. It runs scheduled posts, update checks and plugin jobs on your site. The WordPress Developer Resources explain that it does not run constantly like a system cron and only starts on page load.

Every visit gives WordPress a chance to check for due tasks. If one is due, WordPress sends a background request to wp-cron.php and the task runs there. A site with no visitors never gets that chance.

On our test site, a fresh WordPress and WooCommerce install already had 17 recurring events. WordPress adds update checks and cleanup jobs. WooCommerce adds its own events, including one that wakes the Action Scheduler queue every minute.

WP-CLI list of the WP Cron events on a WooCommerce site

We also tested the default behavior. We scheduled a test task that was 30 seconds overdue and loaded one page. The task had run within five seconds.

That is WP Cron doing its job. It is why the default works for most sites.

Should You Disable WP Cron?

Disable WP Cron when you can add a real cron job to replace it. The page-load trigger is the weak part of the design. A quiet site can run tasks late and a busy site checks for tasks on every visit.

The WordPress handbook says WP Cron on each page load contributes to extra resource usage on your server. It also says an easy fix is to call wp-cron.php from your system’s task scheduler.

WP Cron compared with a real cron job

Do not disable it without a replacement. With the constant set and no real job, scheduled posts and plugin tasks stop running.

Disabling WP Cron also does not make your site faster by itself. It moves the work to a clock. We did not benchmark page speed.

Our guide to why WordPress is so slow helps you check whether cron is even part of your problem. Our steps for fixing slow website loading cover the other common causes. If you want a second pair of eyes, our WordPress speed optimization services include that kind of audit.

How to Disable WP Cron in WordPress

You disable WP Cron by setting the DISABLE_WP_CRON constant to true in wp-config.php. The setting stops WordPress from starting cron on page loads. It leaves the wp-cron.php file in place so that a real cron job can still call it.

  1. Back up first: Copy wp-config.php and take a database backup. Our guide to backing up the WooCommerce database covers the database part.
  2. Open wp-config.php: Use your host’s file manager or SFTP and open the file in your WordPress root folder.
  3. Add the line: Paste the line below above the comment that says “That’s all, stop editing”. The WordPress handbook shows the same line.
    WordPress handbook showing the DISABLE_WP_CRON line for the config file
  4. Save the file: Save wp-config.php and keep a copy of the old version until you finish the checks.

Here is the line:

define( 'DISABLE_WP_CRON', true );

You can also set it from the command line. We ran wp config set DISABLE_WP_CRON true --raw on our test site and it wrote the line for us. wp config delete DISABLE_WP_CRON removed it again.

Worth knowing: Nothing visible changes after this step. On our test site we scheduled an overdue task and loaded three pages. The task stayed overdue.

WP-CLI also reported “The DISABLE_WP_CRON constant is set to true. WP-Cron spawning is disabled.”

Method 1: Run Due Events With WP-CLI

The cleanest replacement for WP Cron is a real WordPress cron job that runs wp cron event run --due-now. This command runs every event that is due and skips the page-load trigger. It needs WP-CLI on your server and works well on a VPS or any host with SSH.

The WP-CLI documentation says the --due-now option respects the doing_cron transient to prevent overlapping runs. That means a slow run does not collide with the next one.

  1. Check WP-CLI: Open a terminal in your site folder and run wp cron event list. A list of events means WP-CLI can reach your site.
  2. Run the due events by hand: Run wp cron event run --due-now and read the result.
    WP-CLI documentation for the wp cron event run command

On our test site this cleared the overdue task and ran the WooCommerce queue event as well.

WP-CLI output after you disable WP Cron and run an overdue task

Now add the command to your crontab. Run crontab -e and add this line, with your own site path:

*/5 * * * * cd /path/to/your/site && wp cron event run --due-now > /dev/null 2>&1

The */5 means every five minutes. The last part hides the output.

We ran the command itself on our test site but did not install a crontab on a live host. On a multisite network the same page lists a --network option that runs due events across all sites. The page notes that this option is not in a stable WP-CLI release yet and you may need the nightly build.

Method 2: Call wp-cron.php With curl or wget

You can also run WP Cron by requesting wp-cron.php over HTTP from a real cron job. This needs no WP-CLI and works on hosts without SSH access. The file still answers requests when the constant is set and keeps the job working after you disable WP Cron.

The WordPress handbook shows a wget example for this. We used curl on our test site with the constant set to true. The request returned HTTP 200 and the overdue task ran.

A curl request that runs an overdue event through the WP cron file

Add this line to your crontab with your own domain:

*/5 * * * * curl -s https://example.com/wp-cron.php > /dev/null 2>&1

If a firewall or a password prompt blocks wp-cron.php, this method fails quietly. Use Method 1 in that case. Also check the cron job logs once, because a blocked request returns an error page and WordPress never sees it.

Method 3: Use the cPanel Cron Jobs Screen

Many hosts give you a Cron Jobs screen in cPanel for picking a schedule and a command. The panel then runs the command on the schedule you chose. The command is the same curl line from Method 2 and the screen needs no SSH access.

The cPanel documentation lists the fields. You can pick a common interval or fill the Minute, Hour, Day, Month and Weekday boxes. It says you must fill all of them plus the Command box.

  1. Open Cron Jobs: Log in to cPanel and open the Cron Jobs tool.
  2. Pick the schedule: Choose a common setting or fill the five time boxes.
  3. Enter the command: Paste the full command into the Command text box. cPanel advises an absolute path for commands.
    Documentation page for cPanel cron jobs showing the fields to add one
  4. Add the job: Click Add New Cron Job.

We did not test the cPanel screen itself because it needs a paid hosting account. The steps above follow the cPanel documentation.

What If Your Host Does Not Allow Cron Jobs?

If your host does not allow cron jobs, an outside scheduler can call wp-cron.php for you. A hosted cron service runs on its own servers and sends a request to your site URL on a schedule. It replaces the visitor as the trigger.

The cron-job.org service describes itself as free and offers a web console. Its site says jobs can run as often as once per minute.

You paste your wp-cron.php URL and pick an interval. The service keeps an execution history with the response and timing of each call. The trade-off is that your tasks now depend on a third party staying online.

How Often Should the Real Cron Job Run?

Run the real cron job every one to five minutes on a store and every five to fifteen minutes on a quiet site. The interval is the longest a due task can wait. A five-minute job means a scheduled post goes live up to five minutes late.

WooCommerce sets its Action Scheduler event to repeat every minute, as the list above shows. A one-minute or five-minute job keeps it close to that rhythm.

The cPanel documentation also warns that scheduling jobs too often can hurt performance. Do not go below what your host allows.

Suggested WP Cron run interval for each type of site

Say your blog schedules posts for 9:00. With a five-minute job the post appears between 9:00 and 9:05. With a 30-minute job it can be up to 30 minutes late.

Pick the interval from how late you can afford a task to be.

What Changes for WooCommerce and Action Scheduler?

WooCommerce runs many background jobs through Action Scheduler and WP Cron starts that queue by default. The Action Scheduler documentation says it is initiated by WP-Cron by default. It also says it runs on the shutdown hook of admin requests.

That means disabling WP Cron removes the front-end trigger. We queued an async action on our test site with the constant set and loaded two front-end pages.

The action stayed pending. WooCommerce showed it as past due on the Scheduled Actions screen.

WooCommerce Scheduled Actions screen with a pending action

If your store is slow for other reasons, our guide to speeding up a WooCommerce website covers the rest.

Method 1 already covers WooCommerce. Running wp cron event run --due-now also ran the action_scheduler_run_queue event on our test site.

You can also run the queue directly. The Action Scheduler WP-CLI page lists the wp action-scheduler run command with options such as --batch-size and --group.

Action Scheduler WP-CLI run completing a pending action

How to Check That Your Cron Job Works

Check the setup right after you add the real job and again a day later. The goal is to see due tasks leave the list on their own. A cron job that never runs looks the same as a healthy site until a scheduled post goes missing.

  • List the events: Run wp cron event list and look at the next run column. Events marked “now” that stay there mean nothing is running them.
  • Expect one message: With the constant set, wp cron test reports that WP-Cron spawning is disabled. That message is normal and does not mean your real job failed.
  • Open Scheduled Actions: On a store, open WooCommerce > Status > Scheduled Actions and watch the Past-due count fall to zero.
  • Schedule a test post: Schedule a draft five minutes ahead and confirm it publishes within your interval.

If nothing runs, call the real command by hand first. A manual run that works points to a cron path or schedule problem and not to WordPress.

How to Turn WP Cron Back On

To turn WP Cron back on, delete the DISABLE_WP_CRON line from wp-config.php or set it to false. WordPress then checks for due tasks on page loads again. Remove your real cron job afterward so the two do not run side by side.

We set the constant to false on our test site and WordPress ran an overdue task on the next request. You can also remove the line with wp config delete DISABLE_WP_CRON.

Conclusion

You can disable WP Cron with one line in wp-config.php, but only after a real cron job is ready. WP-CLI is the cleanest replacement.

A curl call to wp-cron.php works on hosts without WP-CLI. The cPanel Cron Jobs screen works when you have no SSH.

Pick an interval that matches how late a task can be. Then check that overdue events clear and that WooCommerce shows no past-due actions. If you ever want the default back, remove the line.

Frequently Asked Questions (FAQs)

Q1. Is it safe to disable WP Cron?

Yes when a real cron job replaces it. Without a replacement scheduled posts and plugin tasks stop running. We saw an overdue task stay overdue after we set the constant, until WP-CLI or a request to wp-cron.php ran it.

Q2. Will disabling WP Cron make my site faster?

Not by itself. The WordPress handbook says WP Cron on every page load adds extra resource usage.

We did not benchmark it. Any gain depends on your host and how many tasks you run.

Q3. What is ALTERNATE_WP_CRON and is it the same thing?

It is not the same thing. The wp-config documentation describes ALTERNATE_WP_CRON as a different method that redirects the visitor’s browser so cron can keep running.

It does not replace WP Cron with a real cron job and the documentation notes it carries risks.

Q4. Does disabling WP Cron stop WooCommerce Action Scheduler?

It removes the front-end trigger and does not turn Action Scheduler off. On our test site a queued action stayed pending until we ran wp action-scheduler run. Running wp cron event run --due-now from a real cron job also wakes the queue.

Q5. How do I run WP Cron on a multisite network?

Add the --network option to the due-now command. The WP-CLI documentation lists wp cron event run --due-now --network for running due events across all sites. It marks that option as missing from the stable release, and we tested a single site only.

Q6. What URL does a real cron job call?

It calls the wp-cron.php file in your WordPress root, for example https://example.com/wp-cron.php. We confirmed on our test site that the file still answers with the constant set to true. WP-CLI avoids the web request entirely.

Q7. Can I disable WP Cron without editing wp-config.php by hand?

Yes with WP-CLI. Run wp config set DISABLE_WP_CRON true --raw and it writes the constant for you.

We ran it on our test site and the line appeared in wp-config.php. Run wp config delete DISABLE_WP_CRON to undo it.

Yash Kapoor
Yash Kapoor

Yash Kapoor is the founder and WordPress expert at DevDiggers, where he builds WordPress and WooCommerce plugins for loyalty programs, point-of-sale systems, digital wallets and affiliate management. He writes about developer tools, site performance and the technical side of running a WordPress store. He draws on years of building and maintaining production plugin codebases.

Leave a Reply

Your email address will not be published. Required fields are marked *