Disabling WP-Cron and using a server cron

by | Last updated Aug 22, 2022 | Published on Aug 22, 2022 | How-To, Web

The default configuration for WordPress websites is to use a system called WP-Cron; this is an action scheduler so regular tasks in WordPress happen automatically. Unfortunately the WP-Cron is not the most efficient system and depends on users visiting your site regularly in order to trigger – if you have a period of inactivity then tasks can fall behind or not occur at all. Using a server cron is a more robust and reliable solution over the WP-Cron system as it doesn’t rely on regular visitors or any 3rd party activity. This article will cover how you can disable the WP-Cron system and switch to use a standard server cron on your cPanel account.

  1. Log in to your cPanel hosting account. The login page is usually a subdomain of your main domain (e.g. cpanel.example.com). If we host your account and you’re not sure what your credentials are or where the login page is don’t hestiate to contact us
  2. Locate the File Manager in the interface (you can search for it at the top of the page) and open it
  3. Assuming you’re using a default install method for WordPress and your hosting account, navigate to your public_html folder and locate the wp-config.php file, right-click it and choose Edit
  4. In the editor, near the bottom there is a line that states That’s all, stop editing! Happy blogging. – place the following line just above that one:
    define('DISABLE_WP_CRON', true);
  5. Save the file by clicking Save Changes in the top-right of the page then you can click the Close button beside that
  6. Close the File Manager and return to the main cPanel hosting account page, then look for Cron Jobs in the interface (again, you can search for it at the top) and open it
  7. In the Cron Jobs interface, in the drop-down for Common Settings click and change it to Twice Per Hour(0,30 * * * *) – this will automatically fill in most of the fields below it. Note: if you’d like the cron to trigger more frequently then feel free to choose a more frequent setting, we just recommend twice per hour as a default
  8. In the Command: field you’ll need to enter the following line but replace the example.com domain with your actual domain:
    wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
  9. Click Add New Cron Job once the command is entered. When the page reloads you should see the new job under Current Cron Jobs. If you ever need to remove or modify the job you can use the Delete or Edit links to do so
Your site will now be using the server cron instead of the wp-cron system. WordPress may report that there is an issue and that the wp-cron system is not working though regular scheduled tasks should still trigger and complete for you.

Did we miss something?

or do you want to suggest an article?

Would you like Tech Tips in your inbox?

Would you like Tech Tips in your inbox?

Sign up here to receive a monthly business or personal tip to your inbox!

Thanks! You will receive a confirmation email shortly

Share This