How to Disable WP-Cron and Create a Server Cron

Some high-traffic websites slow down due to excessive WP-Cron executions. Yes, these are rare cases, but it can happen. To prevent this from happening to you, in this guide, you will learn how to disable WP-Cron and create a server cron. It only takes two steps, and we are sure you can do it. But first, let’s see what WP-Cron is.

What is WP-Cron and how to disable it?

WP-Cron is a system natively integrated into WordPress that simulates the cron service of a Linux server—a process that runs tasks at specific intervals.

Several functions are automated in WordPress by default. For example, receiving an email every time someone leaves a comment on a blog post or publishing scheduled articles. These automated functions are executed through the WP-Cron function, which is built into WordPress and runs from the wp-cron.php file.

This function is triggered every time someone visits your website. So, each time that happens, the site executes the wp-cron.php file. This can be a problem, especially for high-traffic websites, as it can negatively impact performance.

To prevent this function from dragging down your site’s performance, you can disable WP-Cron in WordPress and use a real server cron job so that scheduled tasks don’t depend on site visits. Let’s see how to do it.

How to disable WP-Cron step by step

To disable WP-Cron, you only need to do two things:

  1. Open the wp-config.php file and add the following line of code: define( 'DISABLE_WP_CRON', true ); Make sure to add it just above the line that says: /* That's all, stop editing! Happy publishing. */ Save the changes.
  2. Create a Cron Job from your hostingHosting Hosting is the service that allows you to store your website online so that others can access it. It's like renting a space on the internet to make your site available 24/7. control panel (such as cPanel) and add this line of code: wget -q -O - https://www.yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 Replace yourdomain.com with your actual domain.

And that’s it! It won’t take more than a couple of minutes.

Important notes to keep in mind

  • Some servers have limits that force you to use longer intervals, sometimes over 30 minutes. If that’s your case, set the lowest interval you can. If there are no restrictions, 5 or 10 minutes is enough—unless you have a site that needs scheduled tasks to run almost immediately, like a news website. In that case, set it to 1 minute.
  • If you need shorter intervals, you might consider using your own server or a third-party cron service, such as EasyCron or Cloudflare workers.
  • Another option is to use the server directory path (e.g., /var/www/wp-cron.php?doing_wp_cron) instead of the URL, so the server executes wp-cron.php directly instead of calling an external domain. Technically, this reduces the server’s workload, though you likely won’t notice the difference.
  • For multisite installations, you only need to configure the Cron Job interval on the network’s main domain. There’s no need to set it up for each individual site.

Why is it a bad idea not to disable WP-Cron?

Ignoring this issue can cause two major problems:

  • If your site has a lot of traffic—over 100,000 daily visits—it could significantly slow down your server’s performance. Do the math: that’s an average of 1-2 visits per second, meaning WP-Cron runs once or twice per second, not counting bots or search engine crawlers.
  • If your site has very little traffic, scheduled tasks might not run at all. In other words, if no one logs into wp-admin and no one visits your site, essential tasks like backups may not be executed. These tasks will pile up and eventually run all at once, but very slowly.

For this reason, disabling WP-Cron is important for both high-traffic sites (highly recommended) and low-traffic sites (recommended). Replacing it with a real server cron ensures wp-cron.php is triggered at defined intervals. Ultimately, this is a scalable solution, and the sooner you implement it, the better.

By disabling WP-Cron, you’ll improve your site’s performance, making it faster and more reliable. If you have a few minutes, give it a try!

Do you have any questions? If you need help or WordPress technical support, feel free to reach out.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *