WordPress has a built-in cron system for scheduling tasks like updates and publishing scheduled posts. Unlike Unix cron, which runs at fixed intervals regardless of activity, WordPress cron relies on website traffic. It triggers wp-cron.php when a visitor accesses the website, meaning tasks may not run on time if traffic is low.
The default WordPress cron system has both advantages and drawbacks. When a website has high traffic, wp-cron.php runs frequently, ensuring timely updates and fresh data for visitors. This is beneficial for websites that rely on real-time plugin updates.
However, if a website has low or no traffic for a period, scheduled tasks may not run until a visitor arrives, potentially causing outdated content. Additionally, if wp-cron.php takes too long to execute, visitors may see delayed or inaccurate data.
Another downside is that multiple cron instances can run simultaneously if tasks take too long to complete, further delaying execution. High traffic can also lead to increased system resource usage, especially if bots crawl the website. In some cases, WordPress cron may slow down page loading times, negatively impacting user experience.
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 limits the execution of wp-cron.php to once per hour, which is typically sufficient for most websites and scheduled tasks. It also helps reduce system resource usage and minimizes the impact on page load times, improving overall website performance.
To replace the WordPress cron with a regular cron job on our servers, you need to:
For more details, check out our article on the Cron Jobs section of the Hosting Control Panel to get familiar with the interface and available options.
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