Skip to content

Disabling WP-Cron and using a real cron job

WordPress has a built-in task scheduler called WP-Cron that handles scheduled events such as publishing posts, sending emails, checking for updates, and running plugin tasks. However, WP-Cron only runs when someone visits your site — it is not a true cron job. This means scheduled tasks can be delayed or missed entirely on low-traffic sites.

Replacing WP-Cron with a real server-side cron job ensures your scheduled tasks run reliably and on time. It also removes the small overhead of checking for due tasks on every page load, which can slightly improve performance.

  1. Log in to cPanel and search for File Manager:

    Searching for File Manager in cPanel

  2. Navigate to the document root for your WordPress site (typically public_html), right-click wp-config.php, and select Edit:

    Right-click wp-config.php and select Edit

  3. Add the following line above the line that reads /* That's all, stop editing! Happy publishing. */:

    define( 'DISABLE_WP_CRON', true );

    DISABLE_WP_CRON added to wp-config.php

  4. Click Save Changes in the top-right corner of the editor.

  1. In cPanel, search for Cron Jobs and open it:

    Searching for Cron Jobs in cPanel

  2. Under Add New Cron Job, select a schedule from the Common Settings dropdown. Once Per Hour (0 * * * *) is a good default for most sites. Sites that depend on more precise scheduling (e.g., time-sensitive emails or frequent post publishing) can use Twice Per Hour or Every 15 Minutes instead.

  3. In the Command field, enter:

    Terminal window
    wget -q -O /dev/null https://yourdomain.com/wp-cron.php

    Replace https://yourdomain.com with your actual domain. The -q flag silences output and -O /dev/null discards the response so it does not accumulate in your hosting account.

    Add New Cron Job form with Once Per Hour and wget command

  4. Click Add New Cron Job to save. The new cron job will appear under Current Cron Jobs:

    Current Cron Jobs showing the newly added wp-cron job

After setting up the cron job, confirm that WordPress scheduled tasks are still running correctly:

  • Scheduled posts should publish on time without requiring a site visit.
  • In the WordPress admin dashboard, plugins that rely on WP-Cron (such as backup or email plugins) should continue to run on schedule.
  • If you use the WP-Crontrol plugin, you can view all scheduled events and confirm they are firing as expected.