What is a Cron?
The Cron system is a time-based scheduler of any task that needs to be updated on a regular basis at a specified time. A good example to explain the Cron system is the weather forecast update every morning. One way is to hire someone to log in to the system each morning and update manually. A better plan is to have a developer make a program that automatically runs every time. This program that fetches the data is called Cron. It is always running in the background to configure data every minute.
What is the WordPress Cron System?
Above, we have talked about the traditional Cron system. WordPress Cron System carries out the process a little differently from the traditional one. WordPress Cron System also works to schedule a task on a regular basis and runs a program every time a website is viewed. It enables WordPress websites to naturally process information in the background without current command. This system is very helpful as many plugin authors need to schedule tasks to happen regularly. WordPress checks the Cron system every time the website is visited to cross-check if any task is to be scheduled and runs them if required. Website owners have the ease of automatic scheduling enabled by the developers. The developers can design routines to undergo every X minutes, hour, or day.
This has proved helpful for scheduling routines like tweeting tweets as well as removing garbage data among others.
How to Enable WordPress Cron System?
The WordPress Cron system is enabled by default for the website. However, for some reason, it can get manually disabled.
To enable the WordPress cron job, open your wp-config.php
file present at foot of the WordPress directory and locate the line:
DISABLE_WP_CRON |
Turn its value to “false” as shown below:
define('DISABLE_WP_CRON', false); |
If you are not able to locate “DISABLE_WP_CRON
” inside your wp-config.php
file, the other possibility is to check your active theme’s functions.php
file.
How to Disable WordPress Cron System?
Websites that have low traffic can handle the WordPress Cron System every time someone visits. However, with increased traffic, this can get inefficient and can lead to resource usage problems for the server.
In order to disable the WordPress Cron System, open the wp-config.php
file in your root WordPress directory and add this line:
define('DISABLE_WP_CRON', 'true'); |
Save the changes.
Now the WordPress will not automatically run the wp-cron.php
script each time your site is visited by a new person.