WordPress has a wp-cron.php file which runs cron-jobs for a WordPress website. With this file, cron-job doesn’t run in a specific amount of time like 5 minutes or 30minutes. Rather than it runs each time an user visits the website. Today we will learn how to disable WP-Cron in WordPress.
How WP-Cron affects your website performance
If you are having good traffic and your website runs cron-jobs on every visit, this will cause multiple processes that are executed, to run the cron. It may kill your resources as well as performance.
How to disable WP-Cron in WordPress
You can disable WP-Cron by adding a simple line of code in the wp-config.php file in your WordPress. Add this following code in wp-config.php:
The problem with disabling the WP-Cron is some features will stop working as they are directly dependent on the cron job. Also plugins that are hooked with WP-Cron will stop running.
So to disable the WP-Cron without having this type of issue, use the above code and at the same time, set up another cron-job manually in your control panel.
You can easily set up cron job and set it for execution on a specific amount of time like 15 minutes, 30 minutes or whatever you want.
*/30 * * * * php /home/$USER/public_html/wp-cron.php
The cron will execute in every 30 minutes and push all output to /dev/null.
Running cron jobs every 30 minutes or even 15 minutes will reduce your resource consumption and may even make your website loading faster.
We hope this tutorial helps you find the perfect solution. If you like our tutorials, definitely you’ll love our support. All VernalWeb hosting plans include 24/7 support from our amazing inhouse support staff. Check out our WordPress hosting plans and have your website migrated today!