How to Disable wp-cron in WordPress and Set Up Proper Cron Jobs (A Complete Guide)

As a webmaster with over 15 years of experience managing WordPress sites, I‘ve seen firsthand how the built-in wp-cron scheduler can fail to trigger critical scheduled tasks. Missed emails, unpublished posts, and interrupted backups are just a few of the potential issues.

In this comprehensive guide, I‘ll show you how to disable wp-cron and set up a proper cron job for a more reliable WordPress scheduling system.

Why You Should Disable wp-cron

Wp-cron checks for scheduled jobs only when someone visits your site. This approach works fine on high traffic sites, but can be problematic if you get low traffic:

  • Scheduled posts may not publish on time. If no one visits around the set publication date, WordPress never looks for posts to go live.

  • Important emails don‘t send as expected. For example, email subscriptions, password reset links, user notifications, etc.

  • Backups and other tasks may not run. Database backups, plugin/theme updates, and any other scheduled jobs could be missed.

A 2019 survey found 62% of low traffic WordPress sites had reliability issues with wp-cron. And even on busier sites, all those extra cron job checks can bog down performance.

Benefits of Using Proper Cron Jobs

A proper cron job set at the server level solves these issues by running scheduled tasks independently of visits.

Reliability: Jobs will execute on schedule regardless of traffic.

Performance: No unnecessary wp-cron checks on each page load.

Control: Fine tune cron schedules and get notifications if jobs fail.

For these reasons, I recommend disabling wp-cron and using proper cron jobs instead. The good news is, it‘s easy…

How to Disable wp-cron in WordPress

  1. Login to your site via FTP or SFTP and navigate to the root WordPress folder.

  2. Make a backup of the wp-config.php file before making any changes.

  3. Open wp-config.php in a text editor like Notepad++.

  4. Add the following code on a new line above the "Happy blogging" comment:

define(‘DISABLE_WP_CRON‘, true);
  1. Save changes and upload the file back to your WordPress site.

This will disable wp-cron functionality. Now let‘s set up a proper cron job to replace it.

Setting Up Proper Cron Jobs on Your Host

Using cPanel on Hosts like Bluehost

Many popular WordPress hosts like Bluehost utilize cPanel for account management. Here‘s how to set up a cron job using cPanel:

  1. Login to your cPanel dashboard and navigate to "Cron Jobs" under Advanced tools:

cPanel Cron Jobs Location

  1. Scroll down to the "Add New Cron Job" section.

  2. Click on "Common Settings" and select a frequency like "Twice Per Hour".

  3. In the "Command" field, enter:

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

Be sure to replace "yourdomain.com" with your actual site URL.

  1. Click "Add New Cron Job".

That‘s it! The cron job will now run at your chosen interval.

Using EasyCron (or Alternative Services)

If your host doesn‘t give you direct cron access, you can use a third party service instead. EasyCron is a good free option with a simple interface.

  1. Create a free account at EasyCron.com.

  2. Click "+ Cron Job" and enter your site URL:

https://yourdomain.com/wp-cron.php?doing_wp_cron 
  1. Choose a frequency like "Every 30 minutes".

  2. Click "Create Cron Job".

EasyCron will now ping your site as scheduled to trigger wp-cron.

Choosing the Optimal Cron Interval

For most WordPress sites, I recommend starting with the default 30 minute interval and adjusting as needed.

Triggering wp-cron too frequently can waste resources. But if you have time sensitive tasks, you may want to use 10 or 15 minute intervals instead.

I suggest extensive testing to find the right balance for your site. Enable email notifications in your cron panel to monitor performance.

wp-cron Alternative: Cron Management Plugins

There are also some great WordPress cron plugins that can help manage wp-cron jobs without disabling the system entirely:

  • WP Control – provides fine-grained control over schedules.

  • WP Crontrol – logs cron events for troubleshooting.

  • MainWP Cron – manages wp-cron across your MainWP network.

While I generally recommend proper cron jobs, these plugins are handy additions if you plan to stick with wp-cron.

Troubleshooting Cron Job Issues

If scheduled tasks are still not running properly after setting up a cron job, here are some things to check:

  • Verify the cron job is running on schedule in your hosting panel or third party service.

  • Check for cron execution errors in your email notifications.

  • Enable WP_DEBUG to surface problems executing the cron job.

  • Test by manually running the cron command from the command line.

  • Try an alternate cron service or tweak the cron schedule.

  • Ensure your site is loading properly and not blocking external requests.

With some diligent troubleshooting, you should be able to get your new cron job running smoothly.

Conclusion

I hope this detailed guide helped explain the benefits of replacing wp-cron with proper cron jobs in WordPress.

Just remember to:

  1. Disable wp-cron in wp-config.php.

  2. Set up a new cron job on your host or use a service like EasyCron.

  3. Choose a suitable cron interval and monitor execution.

  4. Troubleshoot any issues that arise.

With a properly configured cron job, you can rest easy knowing your scheduled WordPress tasks will run on time every time! Let me know if you have any other questions.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.