Or copy link
Copy link
WordPress uses CRON jobs to handle tasks like posting scheduled content, checking for updates, and creating backups. These tasks run through a file called wp-cron.php. WordPress runs this file every time someone visits your site. On busy websites, this can slow down page load times.
To speed up your site, it’s better to turn off wp-cron.php and use a real system cron job. This reduces server load and improves overall performance. It also makes your site more secure by lowering the risk of attacks on the wp-cron.php file. In this guide, we’ll show you how to disable WP-Cron the right way.
In WordPress, the wp-cron.php file helps run scheduled tasks automatically. WordPress triggers wp-cron.php whenever someone visits your site instead of running tasks at fixed times. It then checks if any tasks are due and runs them. Some common tasks handled by this file include publishing posts at a set time, checking for updates, and deleting old comments.
wp-cron.php
If you run a high-traffic website, you might have noticed some performance hiccups with WordPress’s built-in task manager, WP-Cron. It’s important to understand that WP-Cron isn’t a true system cron; it just mimics one to handle scheduled tasks.
By default, wp-cron.php kicks in every time someone visits your site. On busy sites, this can really strain the server, especially if there aren’t enough PHP workers to go around. This can lead to delays in executing scheduled tasks. Conversely, on sites with low traffic, tasks might not run on time since there aren’t any visitors to trigger them.
Disable WP Cron With Ultahost’s cPanel Hosting
Experience Ultahost’s cPanel hosting to easily enable and disable WP-Cron. Our cPanel hosting allows you to automate your site data securely and efficiently.
WP-Cron takes care of important actions like publishing scheduled posts, checking for updates, and managing plugin notifications. As the number of tasks increases, especially on content-rich sites, the server load can rise, which may slow down website.
To boost performance, it’s often a good idea to disable WP-Cron and set up a system-level cron job instead. A system cron runs tasks on a set schedule, no matter how many users are visiting, ensuring that everything gets done reliably and on time.
Disabling the default WP-Cron can help improve the performance of your WordPress website. It does this by stopping the cron system from running every time someone loads a page. To do this, open your WordPress site’s root directory, locate and open the wp-config.php file, scroll down, and add the following line just above the line that says: “That’s all, stop editing!”:
define('DISABLE_WP_CRON', true);
You can enable it at any time when needed. To do this, add the following line to the wp-config.php file:
define('DISABLE_WP_CRON', false);
WordPress will no longer run the `wp-cron.php` file automatically every time someone visits your site. Since we have turned off the default WP-Cron, you will need to set up another way, like a manual cron job or a plugin, to keep your scheduled tasks working properly.
Read also How to Easily Clone Your WordPress Website
We do not want to completely turn off WordPress’s ability to run automatic tasks. However, by stopping it from running on every single visit, we get better control over when these tasks happen. For most users, setting the wp-cron.php script to run every 6 hours is enough. That means it will run only 4 times a day instead of hundreds or thousands of times when your site gets a lot of visitors.
Log in to your cPanel account and open the Cron Jobs section, located under the Advanced tab:
Now, expand the Common Settings drop-down and select the “Once Per Hour” option from it:
Next, expand the Every Hour drop-down and select the “Every Sixth Hour” option:
Finally, enter the following command to trigger the cron job, then click on Add New Cron Job:
cd ~/public_html; php -q wp-cron.php
This command allows you to run WordPress’s cron file (wp-cron.php) directly from your hosting server using an actual cron job:
If everything goes fine, you will be notified with the following message:
Your WordPress site will now automatically handle scheduled tasks with the wp-cron.php script at specific intervals. This way, a real cron job instead of the default wp-cron gives you better performance, more reliable task scheduling, and reduces the chances of overloading your server. Moreover, you can also use free WordPress plugins instead of the control panel to create or modify cron jobs easily.
The wp-cron.php file offers some advantages as well as some disadvantages. Let’s look at its benefits and drawbacks to see if it suits your needs:
Here are some well-known advantages of using the wp-cron.php file:
The wp-crop file has some disadvantages as well, such as delayed task execution on low-traffic sites, too many runs on busy sites, etc. Let’s go through the following disadvantages in more detail to understand where it may fall short:
Disabling the default cron system (wp-cron.php) of WordPress can speed up your website. It reduces the load on your server, especially if your site gets a lot of traffic. Normally, WordPress runs the wp-cron.php file every time someone visits your site. This can lead to performance issues because it may run too often on busy sites or not at all on sites with very little traffic.
By disabling the default wp-cron and setting up a real system cron job, you can control exactly when these background tasks run. It makes sure your scheduled tasks, like posting updates, sending emails, or checking for updates, run more consistently. For example, you can set the cron job to run every 6 hours, which is usually enough for most websites. You can do this using your hosting panels like cPanel, and many free plugins make it easy to schedule cron jobs without much technical knowledge.
We hope this article has helped you disable WP-cron. Consider Ultahost’s fast, user-friendly, and secure WordPress hosting to improve the security of your website. Ultahost provides features like enhanced protection against unauthorized access and unlimited bandwidth. All these features are optimized for superior website performance.
WP-Cron is a built-in WordPress feature that handles scheduled tasks like publishing posts, sending emails, and checking for updates. It runs using the wp-cron.php file.
WordPress disable cron can improve your website’s speed and reduce server load, especially if your site gets a lot of traffic.
If you disable WP-Cron, WordPress will stop running scheduled tasks automatically on every page load. You’ll need to set up a manual cron job to keep tasks running.
Not if you set up a system cron job. Disabling WP-Cron only stops automatic triggering on every visit; tasks can still run on a schedule with a proper system cron.
You can disable it by adding this line to your wp-config.php file: “define(‘DISABLE_WP_CRON’, true);”
Use your hosting panel (like cPanel) to set a cron job that runs the following command: “cd ~/public_html; php -q wp-cron.php”
Yes, many free WordPress plugins allow you to schedule and manage cron jobs without using your hosting control panel.
Tutor LMS is a Learning Management System plugin in Wor...
Deleting a MySQL database and user from cPanel is impor...
Have you encountered the "Serve Static Content From a C...
Managing hundreds of thousands of media files in WordPr...
Controlling access to your website becomes essential fo...
The header is the top section of a webpage. It typicall...
Save my name, email, and website in this browser for the next time I comment.
Δ