Uncategorized

How to Replace the WordPress Cron with a Real Cron Job Tutorial

If you’ve been managing a WordPress site for a while, you may have encountered issues with WordPress’ built-in cron system, WP-Cron. While it’s a handy tool for scheduling tasks like publishing scheduled posts, clearing out cache, or running backups, it can sometimes fall short in terms of reliability and performance. In this tutorial, we’ll guide you on how to replace WP-Cron with a real cron job, enhancing your website’s performance.

Why Replace WP-Cron with a Real Cron Job?

WP-Cron isn’t a true cron system. It runs whenever someone visits your site, meaning its execution depends on website traffic. This can lead to several problems:

  1. Unreliable Scheduling: Tasks might not run on time if there’s low traffic.
  2. Performance Issues: High-traffic sites may experience slowdowns because WP-Cron tries to run tasks too frequently.
  3. Resource Consumption: Running WP-Cron during every visit can unnecessarily consume server resources.

Replacing WP-Cron with a real server-level cron job allows tasks to execute at precise intervals without relying on website traffic, leading to a more predictable and efficient site performance.


Step-by-Step: Replacing WP-Cron with a Real Cron Job

  1. Disable WP-Cron

    To stop WP-Cron from running during every site visit, you need to disable it by editing your wp-config.php file.

    • Access your site’s files via FTP, cPanel, or a file manager.
    • Open the wp-config.php file located in the root directory of your WordPress installation.
    • Add the following line of code above the /* That’s all, stop editing! */ comment:
      define('DISABLE_WP_CRON', true);

    Save and close the file. This will stop WP-Cron from running automatically.

  2. Set Up a Real Cron Job

    A real cron job is a scheduled task set at the server level. Here’s how to create one:

    • Log in to your hosting control panel (e.g., cPanel, SiteGround).
    • Navigate to the Cron Jobs section, often located under the “Advanced” or “System” menu.
    • Add a new cron job and set its frequency. For example, you might want it to run every 15 minutes:
      */15 * * * * /usr/bin/php /path/to/your/website/wp-cron.php

      Replace /path/to/your/website/ with the full path to your WordPress installation. If you’re unsure of this path, check with your hosting provider.

    • Save the cron job.

    That’s it! Your tasks will now run on a reliable schedule without depending on site traffic.


How Does This Tutorial Impact Website Performance?

Switching from WP-Cron to a real cron job can significantly benefit both developers and website owners:

For Developers:

For Website Owners:

By addressing both technical and practical concerns, this change empowers developers to deliver efficient solutions and website owners to maintain a faster, more reliable site.


Replacing WP-Cron with a real cron job might seem daunting, but it’s a straightforward process that can make a world of difference in your site’s performance. By following this guide, you can ensure tasks run on time, improve site speed, and provide a better experience for your visitors.

If you found this guide helpful, feel free to share it with others managing WordPress sites. For further questions, let us know in the comments — we’re happy to help!

Share in X f
JG

Jayson Gumanid

Lead WordPress developer with 13+ years across 100+ builds. Writes about the unglamorous engineering that keeps sites fast and alive. Work with me →

← Previous

Future-Proofing Your WordPress Site: How to Manage Security in 2025