Master WP-Cron monitoring for reliable WordPress
WordPress powers over 40% of websites worldwide. Behind every WordPress site is WP-Cron, the scheduled task system that handles everything: from scheduled posts to automatic backups, email sending, and plugin updates. When WP-Cron stops working, the consequences can be disastrous.
Unlike Linux system cron, WP-Cron doesn't run autonomously. It depends on site visits to execute, creating a fundamental problem: a low-traffic site can have tasks delayed by several hours. Additionally, aggressive caching plugins can completely block WP-Cron execution with no alert.
The recommended solution is to disable native WP-Cron in favor of a system cron, then monitor that cron with MoniTao. This approach guarantees reliable and predictable execution of your WordPress tasks, regardless of your site's traffic.
The WP-Cron mechanism has several technical limitations that impact the reliability of your scheduled tasks:
The professional solution is to replace WP-Cron with a reliable system cron:
These WordPress tasks depend on WP-Cron and require particular monitoring:
Here's how to integrate a MoniTao heartbeat directly into your WordPress tasks:
// In functions.php or a custom plugin
// Create a custom hook for the heartbeat
add_action('monitao_hourly_heartbeat', 'monitao_send_heartbeat');
function monitao_send_heartbeat() {
$ping_url = 'https://api.monitao.com/ping/your-token';
$response = wp_remote_post($ping_url, [
'timeout' => 10,
'body' => json_encode(['status' => 'ok']),
'headers' => ['Content-Type' => 'application/json']
]);
if (is_wp_error($response)) {
error_log('MoniTao heartbeat failed: ' . $response->get_error_message());
}
}
// Schedule the heartbeat (if not already scheduled)
if (!wp_next_scheduled('monitao_hourly_heartbeat')) {
wp_schedule_event(time(), 'hourly', 'monitao_hourly_heartbeat');
}
This code creates a WP-Cron task that pings MoniTao every hour. If the ping stops arriving, MoniTao alerts you that your WP-Cron is no longer working. You can adapt the interval (hourly, twicedaily, daily) according to your needs.
Several complementary approaches allow you to effectively monitor your WordPress tasks:
When WP-Cron doesn't work as expected, use these diagnostic techniques:
WP-Cron wasn't triggered between the scheduling moment and publication time. Without traffic on your site (or with aggressive caching), WP-Cron stays inactive. The solution: disable native WP-Cron and configure a system cron that calls wp-cron.php every 5 minutes.
Native WP-Cron runs on every page load, adding latency. By adding DISABLE_WP_CRON and using a system cron, you completely remove this overhead. Visitors no longer trigger scheduled tasks, which significantly improves response times.
Install the WP Crontrol plugin from the WordPress repository. It displays all scheduled tasks, their hook, their next execution, and allows manual execution. From the command line, use wp cron event list with WP-CLI.
UpdraftPlus depends entirely on WP-Cron. First check that WP-Cron is working by consulting the UpdraftPlus > Settings > Advanced page. If "Unable to use WP-Cron" appears, configure a system cron. Then monitor this cron with MoniTao to be alerted if backups stop.
Several solutions exist: use a free external cron service (cron-job.org, EasyCron) to call your wp-cron.php, or use ALTERNATE_WP_CRON mode which bypasses certain limitations. MoniTao can monitor these external calls to guarantee their reliability.
Create a MoniTao heartbeat that pings from a WP-Cron task (see code example). If the ping stops, WP-Cron is down. You can also manually check by calling https://your-site.com/wp-cron.php?doing_wp_cron in your browser and checking the server logs.
WP-Cron is a simple but fragile system, designed for sites with regular traffic. In reality, many WordPress sites have irregular traffic or use aggressive caching that makes WP-Cron unreliable. The consequences range from unpublished posts to missing backups.
The professional solution combines a reliable system cron with external MoniTao monitoring. This approach guarantees that your WordPress tasks execute according to the planned schedule, and alerts you immediately in case of problems. Start by monitoring your most critical tasks: backups and scheduled publications.
Start free, no credit card required.