WP-CRON

Last modified: March 5, 2021
You are here:
Estimated reading time: 2 min

In this documentation, we can learn about Wp-Cron’s functionality and how to disable the Wp-Cron.

 

What is CRON

The cron is a utility used to schedule tasks in Unix-like computer operating systems. The tasks scheduled with cron are called cron jobs. They can be commands, scripts, etc. For a cron job, we can set minute, hour, day of month, month and day of week attributes. In addition, we need to provide a command to execute.

The system will consist of a crontable, otherwise crontab and the cron jobs are saved here. A cronjob format is as follows.

Minute, hour, day of month, month, day of week, command to execute.

What is WP-CRON?

Wp-Cron is used for setting up cron jobs. The cron jobs are intended to run in particular time of the server. Unlike the usual cron jobs, Wp-Cron function will run every time a user visits the WordPress powered website. This eliminates a lot of server-specific requirements, and helps the non-stop running of the web site.

Wp-Cron.php is a php file that comes with the WordPress. WordPress is a content management system where you can manage the content of your website without the need of being tech savvy and the knowledge about what is happening in the back-end. WordPress is installed in different servers all carrying different setups. In order to work well in these various setups, the developers also implemented a virtual cron which helps running scheduling jobs such as:

1) Checking for theme and plugin updates

2) Checking Conflict of plugins

3) Publish scheduled posts

4) Checking DNS-related issues

5) Checking WordPress bugs

6) Sending pingbacks, etc

 

Working of WP-CRON

When a page is loaded, WordPress will check whether the Wp-Cron is required to run. If necessary, a HTTP request to the Wp-Cron file is established and it will run the file. Some jobs may take more time to finish than others. The site must be available without any load issue. Wp-Cron makes ensures that a site will load without any problems. It functions as a separate process in the background and the page requests will be processed without any delay. Once the Wp-Cron function starts running, it will keep running until all the jobs are finished or until a predefined execution time is reached. In some high-traffic websites, it may cause issues. However, we can tweak WordPress to ensure that it runs smoothly.

 

How to disable Wp-Cron?

We can disable the WP-Cron as follows:

1) Open the wp-config.php

2) Add the below line to it.

define(‘DISABLE_WP_CRON’, ‘true’);

3) Save and exit.

Now Wp-Cron is disabled and it will not be executed automatically.

 

If you need any further help please contact our support department.

Was this article helpful?
Dislike 0
Views: 9