WP-Cron WordPress Monitoring

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.

Common WP-Cron Problems

The WP-Cron mechanism has several technical limitations that impact the reliability of your scheduled tasks:

Best Practice: System Cron

The professional solution is to replace WP-Cron with a reliable system cron:

  1. Disable native WP-Cron: Add define('DISABLE_WP_CRON', true); to your wp-config.php file. This prevents WordPress from checking tasks on every page load.
  2. Configure system cron: Add a crontab entry that calls wp-cron.php every 5 minutes: */5 * * * * wget -q -O /dev/null https://your-site.com/wp-cron.php?doing_wp_cron
  3. Monitor with MoniTao: Create a MoniTao heartbeat for this system cron. If the cron doesn't execute, you'll be alerted immediately instead of discovering the problem days later.

Critical WordPress Tasks

These WordPress tasks depend on WP-Cron and require particular monitoring:

Heartbeat Integration Example

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.

WordPress Monitoring Strategies

Several complementary approaches allow you to effectively monitor your WordPress tasks:

Debugging WP-Cron

When WP-Cron doesn't work as expected, use these diagnostic techniques:

WP-Cron Checklist

  • Add DISABLE_WP_CRON to wp-config.php
  • Configure system cron to call wp-cron.php
  • Create a MoniTao heartbeat for this cron
  • Identify all critical tasks (backups, emails)
  • Install WP-CLI or WP Crontrol for diagnostics
  • Manually test a wp-cron.php execution

Frequently Asked Questions

My scheduled posts don't publish at the scheduled time. Why?

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.

WP-Cron slows down my site. How can I optimize it?

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.

How can I see pending WP-Cron tasks and their status?

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.

My UpdraftPlus backup doesn't run automatically. What should I do?

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.

My shared hosting doesn't allow crons. What alternatives exist?

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.

How do I know if WP-Cron is working correctly?

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.

Reliable WordPress with Monitored Cron

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.

Ready to Sleep Soundly?

Start free, no credit card required.