A guide to disable WP-Cron

Updated on September 24, 2021

What is wp-cron?

WP-Cron carries out specific duties for WordPress-powered websites. Cron is derived from the Unix system for scheduling jobs at intervals ranging from once a minute to once a year. Any command running on Unix without human involvement may be scheduled as a Cron task, whether normal maintenance or scheduled notifications.

This would be fine for low-traffic sites, but as your site visitors increase, checking for scheduled activities many times might be inefficient and cause resource consumption issues for the server, making your website run slower.

WordPress uses a file named wp-cron.php as a virtual cron job, or scheduled activity, to automate tasks such as:

  • Publish scheduled posts
  • Check for theme and plugin updates
  • Email Notifications
  • Website backups
  • Auto WordPress Updates

How does it work?

Without going into too much details about why using the WordPress Cron Job isn’t the best idea, it’s simply the way it works!. 

If you have a plugin that runs itself at 10 p.m., but there are no visitors on your website at that time, no cron tasks will execute at that time. If you intend to schedule backups in the evening, believing that it is preferable when there are no visitors — it’s not a good practice.

Rather than scheduling a WordPress backup, create a server backup. They’re more dependable in any case because they don’t need visitors to your site, and the event will take place at the server time.

Benefits of using an External Cron Job

You may be considering alternatives to the WordPress Cron Job.

Since many websites would not get visitors every second, there must be another solution.

External Cron Jobs are the solution.

  • You have more control over when it runs. You have complete control over the minute, hour, day, and so on.
  • It is simpler to write code and oversee its operation. It removes the task’s looping and timing logic, and you can adjust the timing or turn it off via crontab.
  • When it’s not running, it doesn’t take up any RAM of your system.
  • If it fails and exits for any reason, it will restart when the appropriate time comes.

How to disable WP-Cron?

It is quite simple to disable the WP-Cron by following the steps below.

  1. Connect your Server via SSH
  1. Locate wp-config.php File
  • After connecting the server, go to the webroot of your web application.
  • Go to: cd applications/application_folder_name/public_html
  • Open wp-config.php file and just before /* That’s all, stop editing! Happy publishing. */ edit the below rule:
define('DISABLE_WP_CRON', true);

Note: This prevents it from running when the page loads, rather than calling it directly via wp-cron.php.

Need More Help!

Type in your question at the knowledge base website or comment below

Leave a Comment

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