How to Disable WP-Cron in WordPress

WordPress

Cron Jobs are used to performing scheduled tasks. Cron is used to schedule scripts to run automatically at a specific time or at predetermined intervals. WordPress also uses Cron jobs for several tasks like scheduling a post or checking for updates. Backup plugins also use Cron jobs to run at a predefined schedule.

Cron is a feature of Unix and Linux systems for scheduling commands. It is basically used to execute certain commands automatically at a specific time. These commands are called cron jobs. WordPress also uses Cron jobs for some features. Plugins and themes can also use cron jobs to execute some commands at regular intervals. Cron Jobs in WordPress is handled by WP-Cron (wp-cron.php). Whenever the WordPress Cron handler starts, it slightly impacts the performance of the website. It is worth noting that WP-Cron is not exactly the system Cron job, it just mimics that. It doesn’t run continuously, but it fires on every page load. If your website has high traffic, it will surely impact the load time. If the website doesn’t have much traffic, some CRON tasks could be missed at the scheduled time because no one has loaded a page.

Best Managed WordPress Hosting

WPEngine is the best and most secure managed hosting provider

A better approach is to disable the WP-Cron and use the system CRON. If you do not use any of the features that use Cron, you can also think of Disabling WP-Cron.

How to Disable WordPress CRON

To disable the WordPress CRON Job, open the wp-config.php file located at the root of your WordPress installation. Now locate the line define(‘DB_COLLATE’, ”); in the file. Just below this line, add the following line.

define('DISABLE_WP_CRON', true);

Now WP_CRON will not be executed on each load. If you want to use the WordPress Cron jobs, you can now use system CRON to run wp-cron.php at specific time intervals. You can do that using cPanel which has an easy-to-use interface for creating Cron Jobs.

If you ever decide to enable the WordPress CRON again, you just need to change the variant from true to false. The line will now be as shown below.

define('DISABLE_WP_CRON', false);

Wrap up

Now you know how to disable WordPress Cron. If you are disabling WordPress CRON, make sure you use the system CRON. Otherwise, several features dependent on CRON will stop working.

I hope this article was useful. Do not forget to like our Facebook page and Twitter profile for the latest updates.

Tags:

Deepanker Verma is an experienced WordPress developer who has been working on WordPress for more than 12 years. On TheWPGuides, he writes about WordPress, WordPress development, and WordPress plugins.


Similar Articles

0 Comments

Leave a comment

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.

© 2022 The WP Guides Developed By Deepanker