WordPress uses a system similar to the Unix cron that runs scheduled tasks like checking for updates, applying automatic updates, publishing scheduled posts, etc. The WordPress cron does not always run on the server like the Unix cron; it works by loading the wp-cron.php file when a visitor accesses a page of the WordPress website.
The default behavior of relying on visitors to access a page of a WordPress website comes with some benefits and downsides. The main benefit is that the WordPress cron will be checked regularly for jobs that should be executed if there are a lot of visitors on the website. This is crucial for high-traffic websites that rely on retrieving timely updates or data through plugins via the WordPress cron as the data presented to the website visitors will be up-to-date. This may also backfire as your WordPress cron may not run for extended periods if there are no visitors on your website for some time. The WordPress cron will run after a visitor arrives at your website; however, depending on the time it takes for the WordPress cron to finish, the visitor may see inaccurate data. It is also important to mention that multiple instances of the WordPress cron can run simultaneously when they take too long to finish, so this may additionally delay the execution of the scheduled tasks. Another big downside of the default WordPress cron execution mechanism is that it may result in an increased usage of system resources when there are a lot of visitors on the website (if your website is crawled by bots for example). Another downside is that the WordPress cron may actually increase the page loading time for your visitors and negatively impact their experience on your website.
To try and reduce the downsides of the default WordPress cron mechanism, you can add the following line to the WordPress configuration file:
define( 'WP_CRON_LOCK_TIMEOUT', 3600 );
This line sets the minimum execution interval of the WordPress cron to one hour, which is usually sufficient for most websites and WordPress scheduled tasks, but still helps significantly in reducing the usage of system resources and the negative effects on your website's page load times.
All WordPress applications pre-installed on the hosting account or installed through the hosting Control Panel > WordPress Manager will have this line added to the WordPress configuration file by default.
To replace the WordPress cron with a regular cron job on our servers, you need to:
All prices are in USD. No setup fees. Minimum contract period for shared hosting services - 12 months. Full prepayment for the contract period. 100-day money-back guarantee. No automatic renewal. Fees for domain registrations and SSL certificates cannot be refunded in case of an early contract termination.
ICDSoft 2001-2025 © All rights reserved
Terms of Use
|
Legal notice
|
Privacy
|
Reseller terms