By default, automatic task handling in WordPress is controlled by wp-cron.php. This script is used by WordPress to run scheduled tasks for your WordPress site. Unfortunately, this file is set to be called on every page view, even when it isn't needed, which in turn can cause higher than needed use of resources on the server.
WordPress defaults to this behavior because some hosts do not allow manual cron jobs to be created and the tasks have to be carried out by this script instead. Since WordPress can be installed on so many different hosts, the developers are trying to make sure it will run as expected whatever the environment.
Once a blog begins to add users and traffic increases, this can cause issues for your account because the script is called for every single page view. Fortunately, it's fairly easy to disable this default behavior and set up a proper cron job through cPanel for WordPress task management. This will be a much more efficient way to run the tasks needed for WordPress, and can even optimize your WordPress site.
define('DISABLE_WP_CRON', true);
php -q /home/userna5/public_html/wp-cron.php
Make sure that you replace userna5 with your actual cPanel user name and that the path to wp-cron.php includes the full path to that file. For this example since I have WordPress installed on wp.example.com (with the document root of that subdomain being public_html/wp), my command would look like:php -q /home/whhsup5/public_html/wp/wp-cron.php
We've now disabled the default WordPress cron behavior and created a more reasonable cron job for WordPress task management.
Keep in mind with these changes that when you make changes to your WordPress site, it may take a few minutes for the changes to appear as the cron will need to run the tasks needed. If you have any questions, please feel free to submit a question in our Support Center.
Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
---|---|---|---|
Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!