The Short Version
Set up a real cron job to request wp-cron.php every five minutes, using either your hosting control panel or the server crontab. Then add this line to wp-config.php:
define('DISABLE_WP_CRON', true);A standard curl cron job looks like this:
*/5 * * * * /usr/bin/curl -fsS https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Swap example.com for your domain. If you’re working in cPanel, enter only the command portion. The schedule goes into separate fields.
Don’t disable WP-Cron until you’ve created and tested the server cron job. If you do it in the other order, scheduled posts, backups, email notifications, and maintenance jobs may stop running.
Why Replace WordPress WP-Cron?
WP-Cron is WordPress’s built-in task scheduler, though it doesn’t behave like the cron daemon on a Linux server. It isn’t running continuously in the background. Instead, WordPress checks for due tasks when somebody visits the site.
That traffic-based setup can cause two familiar problems:
- On a low-traffic website, scheduled tasks may run late.
- On a busy site, a lot of page requests may trigger WP-Cron checks that aren’t needed.
A real cron job follows a fixed interval. Scheduled posts, WooCommerce actions, plugin maintenance, and backup jobs should run more predictably as a result.
What You’ll Need
- Access to the site’s
wp-config.phpfile - Access to cPanel, Plesk, DirectAdmin, or the server crontab
- A recent backup of the website
- The full HTTPS URL for the WordPress installation
Step 1 — Turn Off the Default WP-Cron Trigger
In the root directory of the WordPress installation, open wp-config.php. Add the following line above the comment that says That’s all, stop editing:
define('DISABLE_WP_CRON', true);This keeps WordPress from checking scheduled events during ordinary page requests. Existing events aren’t deleted, and wp-cron.php can still be called directly.
One quick check before saving: make sure the constant hasn’t already been defined somewhere else in the file. Define it twice and PHP may produce a warning.
Step 2 — Add the Server Cron Job
Use curl
For most Linux hosting accounts, curl is probably the easiest choice:
*/5 * * * * /usr/bin/curl -fsS https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1The schedule */5 * * * * runs the command every five minutes. In the curl options, -f causes the command to fail on HTTP errors. The combined -sS hides routine output while still showing useful error messages during a manual test.
Use wget
No curl on the server? wget does the same job through an HTTP request:
*/5 * * * * /usr/bin/wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Use WP-CLI
WP-CLI runs due events straight from the command line, so there’s no HTTP request involved. On a VPS or dedicated server, it’s often the better option.
*/5 * * * * cd /var/www/html && /usr/local/bin/wp cron event run --due-now --quiet >/dev/null 2>&1Change /var/www/html to the directory where WordPress is installed. To confirm the location of WP-CLI, run:
which wpThe cron command should run under the account that owns the WordPress files. Don’t run WP-CLI as root unless that’s genuinely required, since it can create files with the wrong ownership.
Setting Up WP-Cron in cPanel
- Sign in to cPanel.
- Under the Advanced section, open Cron Jobs.
- Choose Once Per Five Minutes. You can also enter
*/5in the Minute field and*in every remaining schedule field. - Paste in the curl or wget command, leaving out the five schedule fields.
- Click Add New Cron Job.
So, for cPanel, the command field itself should contain only this:
/usr/bin/curl -fsS https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Choosing a Method
| Method | Best for | What to keep in mind |
|---|---|---|
| curl | Most hosting accounts | The cron URL has to be reachable |
| wget | Servers without curl | It also relies on an HTTP request |
| WP-CLI | VPS and dedicated servers | You need shell access and WP-CLI |
Checking That WordPress Cron Works
Start by running your chosen command manually. With curl, success usually means no output at all:
/usr/bin/curl -fsS https://example.com/wp-cron.php?doing_wp_cronIf you’re using WP-CLI, list the scheduled events with this command:
wp cron event list --fields=hook,next_run_relative,recurrenceA scheduled test post is another useful check. Set one to publish a few minutes in the future, wait through at least one full cron interval, then see whether WordPress published it.
Common Problems
The Cron URL Returns 403 or 503
Something may be blocking wp-cron.php, such as a firewall, security plugin, maintenance mode, or a hosting rule. Allow requests to the file. If that isn’t practical, use WP-CLI instead.
Scheduled Posts Still Run Late
Check that the cron job is actually running every five minutes and that the server uses the time zone you expect. Then look at the WordPress time zone under Settings > General. A mismatch there can throw off the timing.
The Command Works Manually but Fails in Cron
Cron runs with a limited environment, and it may have no idea where an executable lives. Use full paths such as /usr/bin/curl, /usr/bin/php, or /usr/local/bin/wp.
A Few Sensible Practices
- For most websites, run the job every five minutes.
- Use WP-CLI where it’s available. It avoids interference from firewalls and caching.
- Don’t schedule the job every minute unless the site has time-sensitive work that genuinely needs that frequency.
- After the change, keep an eye on backups, email, and WooCommerce scheduled actions.
- While troubleshooting, temporarily remove output redirection so you can see the errors.
