How to set up WordPress cron properly (disable wp-cron and use a cPanel cron job)
WordPress runs scheduled tasks (publishing scheduled posts, sending emails, WooCommerce jobs, backups) through a file called wp-cron.php. By default it is triggered by visitors, which can slow busy sites and makes tasks unreliable on quiet ones. This guide shows you how to set up WordPress cron properly: disable the built-in wp-cron trigger and run it on a fixed schedule with a cPanel cron job.
Why change it?
- Busy sites: wp-cron may start on many page loads, adding server load and making some requests slow.
- Quiet sites: if nobody visits, tasks do not run. Scheduled posts show "Missed schedule" and emails or backups are delayed.
- A real cron job runs at a predictable interval whether you have visitors or not.
Step 1: Disable the visitor-triggered wp-cron
- Take a backup of
wp-config.php(or the whole site: see how to back up and restore your website). - In cPanel open File Manager, go to your site folder (usually
public_html) and editwp-config.php. - Add this line above the line that says
/* That's all, stop editing! */:
define( 'DISABLE_WP_CRON', true );
Save the file. Make sure the line is not already there with a different value.
Step 2: Add a cron job in cPanel
- Log in to cPanel (see how to log in to cPanel) and open Cron Jobs.
- Under Add New Cron Job, choose a schedule. Every 5 or 15 minutes suits most sites. In the advanced fields, every 15 minutes is:
Minute: */15 Hour: * Day: * Month: * Weekday: *
- In Command, enter one of the following, replacing
USERNAMEwith your cPanel username and the path with your site's folder:
cd /home/USERNAME/public_html && /usr/local/bin/php -q wp-cron.php >/dev/null 2>&1
Running it with PHP directly avoids web traffic and timeouts. If your site is in a subfolder or an addon domain folder, change the path accordingly.
Alternative (calls the site over HTTPS, useful if the site is on another server path or behind special rules):
wget -q -O /dev/null "https://yourdomain.com/wp-cron.php?doing_wp_cron" >/dev/null 2>&1
- Click Add New Cron Job. The
>/dev/null 2>&1part stops cPanel from emailing you every run.
Step 3: Check that it works
- Install the free WP Crontrol plugin and open Tools > Cron Events. Events should show a "next run" time in the near future, not overdue ones.
- Schedule a test post a few minutes ahead and confirm it publishes.
- For WooCommerce, check WooCommerce > Status > Scheduled Actions for a growing list of "Past-due" actions.
Tips
- Don't run the job every minute on shared hosting; every 5-15 minutes is enough for almost all sites.
- One cron job per WordPress site. If you have several sites, add one for each with its own path.
- If the cron job uses the wrong PHP version, check your PHP settings in cPanel; see how to change the PHP version.
Common problems
- "Missed schedule" still appears: the cron job path is wrong, or
DISABLE_WP_CRONwas added but the cron job was not. Check the command and the folder. - Cron emails flood your inbox: add
>/dev/null 2>&1to the end of the command, or clear the Cron Email field. - Thousands of overdue WooCommerce actions: a plugin may be creating too many jobs. Ask our support team to look before deleting anything.
Frequently asked questions
Is it safe to disable wp-cron?
Yes, as long as you replace it with a real cron job. WordPress then runs the same tasks on your schedule.
Does a real cron job speed up my site?
It removes the extra work from visitor requests, which helps busy sites. For other improvements see how to speed up your WordPress website.
Can I use WP-CLI instead?
If WP-CLI is available on your plan, you can use wp cron event run --due-now in the cron command from your site folder. The PHP command above works on all plans.
Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.