0 items
24/7 Support & Sales   1300 210 210
Online Support Web Hosting

Disable the wp-cron.php in WordPress

WordPress uses a file called wp-cron.php to run scheduled tasks such as publishing posts, checking for plugins, theme updates, and sending notifications. However, this file cannot self-execute. It only checks for scheduled tasks whenever someone visits your site.

It works fine with sites that get decent traffic, but not necessarily for sites with high and low traffic. If your site gets high traffic, tasks will pile on top of each other, consuming server resources. For sites that get low traffic, it will take time before your tasks can be executed.

By default, WordPress views the wp-cron.php and asks it for tasks. So, turning it off and forgetting about it is not recommended. You just have to disable the default file and then set up a Cron Job on the Hosting Manager to automate a command on your site.

Disable default wp-cron.php

Follow the steps given to disable default wp-cron.php:

  1. Click on My Account at the top of this page.
  2. Select Hosting Manager from the drop-down menu.
  3. Enter your username and password and click Log In.
  4. On the Home page, click Files or the [ v ] arrow symbol on the right side, then click File Manager.
  5. Select Web Root (public_html/www), then click Go.
  6. Locate wp-config.php, right click on it, and select Code Edit.
    You can also click wp-config.php, then select Code Editor button on the upper part of the page.
  7. A code editor popup will display, just click Edit.
  8. Look for the database setting in wp-config.php file. Then, add the following bolded code in the location indicated:
    /** The Database Collate type. Don't change this if in doubt. */ 
    define('DB_COLLATE', '');
    define('DISABLE_WP_CRON', 'true');
  9. Click Save Changes at the upper right corner.
WordPress will no longer run wp-cron.php file whenever there is a visitor. To automate certain commands, proceed to setting up a cron job for wp-cron.php.

Set up a manual cron job for wp-cron.php

After you have disabled the default wp-cron.php, you can now control wp-cron.php by setting up a manual cron job. Follow the steps below to be guided.

  1. Click on My Account at the top of this page.
  2. Select Hosting Manager from the drop-down menu.
  3. Enter your username and password and click Log In.
  4. On the Home page, click Advanced or the [ v ] arrow symbol on the right side, then click Cron Jobs.
  5. Scroll down to Add New Cron Job.
  6. On the box provided for Common Settings, select Once Per Hour (0****).
  7. On the Common Settings under Hour, select Every Sixth Hour (*/6).
  8. Scroll down to Command field, and enter the following code to run the cron job:
    cd /home/username/public_html; php -q wp-cron.php

    (This refers to the primary domain /home/username/public_html, if your WordPress was installed in a sub directory, set this path to the correct location).

  9. Click Add New Cron Job.

Congratulations! Your WordPress site will now run the wp-cron.php script at the scheduled intervals.

If you want to know how to install WordPress on your Web Hosting, click here.

If you want to know how to fix database connection error on WordPress, click here.

If you want to know how to fix an internal server error on WordPress, click here.

Was this helpful? Yes No 92% of people found this helpful.