How to disable WP-Cron (wp-cron.php) for faster performance illustration

CRON jobs are used to schedule tasks at regular times, dates, or intervals on your WordPress site. Some examples of WordPress cron jobs may involve scheduling posts to be published, checking for updates, or backup plug-ins that run on a predefined schedule.

in WordPress, which is handled by WP-Cron, is used to simulate the system cron. However, depending on the traffic on your site, using the built-in cron processor will actually start to affect your page load time. So today we’ll show you how to disable WP-Cron (wp-cron.php) and use system cron instead for faster performance. Performance problems of

  • WP-Cron
  • how to disable WP-Cron
  • how to schedule system Cron

WP-Cron performance problems

WordPress built-in Cron processor WP-Cron has a lot of performance problems. First of all, it is important to understand that WP-Cron is not really cron work, it is just created by WordPress to mimic the work done by the system cron.

WP-Cron does not run continuously. By default,wp-cron.phptriggers every time a page is loaded, which can cause problems on high-traffic sites. If a site doesn’t have enough PHP workers, sometimes a request comes in, and WordPress generates cron, but cron has to wait for worker, so just sit there. The opposite is true of

. If a site does not have a lot of traffic, the schedule may be missed because no one loads the page. A better approach to

is to disable WP-Cron and use system cron instead. This runs on a predefined schedule and is even recommended in the official plug-in manual. How to disable

WP-Cron

to disable WP-Cron, please add the following to yourwp-config.phpfile, in “That’s all, stop editing! Happy blogging. ” Note: this will disable it from running when the page loads, rather than when you disable how WP-Cronwp-cron.php.

define('DISABLE_WP_CRON', true);

How to disable WP-Cron (wp-cron.php) for faster performance illustration1

schedules the system Cron

directly through

, then you will needwp-cron.phpto schedule it from your server.

if your site is multi-site, you need to perform some additional setup steps to run cron jobs for your subsites. Here are some resources we can recommend for this:

  • uses WP CLI to run Cron jobs on multi-site networks
  • runs WordPress cron

on multi-site instances for single-site WordPress, it is recommended that you view the correctly set up WordPress Cron jobs to learn how to set up the system cron.

creates a Cron job

in cPanel. If you use a host with cPanel, you can also create a system cron from its control panel. Note: make sure to disable the default WP-Cron above first.

Step 1

logs in to cPanel. In the Advanced section, click the Cron Job.

How to disable WP-Cron (wp-cron.php) for faster performance illustration2

cPanel scheduled tasks

Step 2

under the Add New Cron Job section, you can choose from many different predefined plans, such as twice an hour or once a week. Your managed service provider is likely to have restrictions on how often cron jobs are allowed to run. Twice an hour is a common setting for shared hosts.

How to disable WP-Cron (wp-cron.php) for faster performance illustration3

cPanel cron Job Settings

Step 3

adds the following command. Replacehttps://domain.comwith your domain name. Depending on how your host is configured, this command may be slightly different. Then click Add New Cron Job.

wget -q -O - https://domain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

How to disable WP-Cron (wp-cron.php) for faster performance illustration4

cPanel adds a new cron job

>/dev/null 2>&1some of the above command disables email notification.

uses a third-party solution to schedule Cron

if you are not used to setting up cron jobs on the server or if your managed service provider does not provide access, you can also use a third-party solution, such as EasyCron.

Disclaimer: All articles on this website, unless otherwise specified or marked, are original and published on this website. Any individual or organization is prohibited from copying, stealing, collecting, or publishing the content of this site to any website, book, or other media platform without the consent of this site. If the content on this website infringes on the legitimate rights and interests of the original author, you can contact us for assistance.