Support
Web Development

WP-CRON: What is it and how can you disable it to improve the performance of your WordPress site

What is WP-CRON?

WP-CRON (wp-cron.php) is a WordPress tool designed to run automated/programmed processes and is used by both the CMS's core and plugins installed on the site. Unlike Server Cron Jobs, WP-CRON does not run based on any scheduling, but instead runs with each page load on the site. Therefore, it is not actually a tool for scheduled actions.

The negatives of WP-CRON

With such implementation, there is smoothness if the website has a moderate number of visits, however problems arise when we have one of the following:

  • Low traffic: Due to the fact that WP-CRON is executed when the page is loaded, when it comes to a website with not frequent visits, it stands to reason that scheduled commands are not executed at the time specified.
  • High traffic: On the contrary, when the site has high traffic, WP-CRON ends up being executed multiple times which can cause major performance issues and exhaust the server resources.

These issues can be solved by replacing this implementation with a (real) Cron Job directly through our account's cPanel.

What is a Cron Job?

A Cron Job is a tool provided by Linux systems through which we can program commands that are executed at specific recurring intervals. Cron jobs can be set to run from every minute to every year.

How do I disable WP-CRON?

? Disabling WP-CRON is fairly easy and straightforward. All we need is to add a command to the wp-config.php file, just before the line “That’s all, stop editing! Happy blogging.”

define('DISABLE_WP_CRON', true);

How do I add a Cron Job for WordPress via cPanel?

To take advantage of the actual scheduling tool, we'll go through the cPanel, under Advanced > Cron Jobs.

We then set the frequency at which we want WP-CRON to run. The frequency options vary and depend mainly on the actions that are scheduled to run. By clicking on "Common Settings", there are ready-made scheduling templates such as every minute, every 5 minutes, twice an hour, etc. For more complex implementations you can also use an online tool like crontab.guru.

Finally, add the following command in the "Command" field and click "Add New Cron Job":

wget -q -O - https://example.gr/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Attention: replace example.gr with the domain of your installation.







IPGLOBAL IKE   |  IP.GR Web Hosting and Domain Name registration services in Greece
Cookies Preferences
 Functional  Statistics  Marketing


You can see detailed information about the use of cookies on the page: Terms of use