Troubleshooting and Fixing WordPress Cron Jobs Not Running

Understanding WordPress Cron Jobs

WordPress uses a pseudo-cron system called WP-Cron to handle scheduled tasks. Unlike traditional server cron jobs, WP-Cron is triggered only when a visitor loads a page on your website. This means if no one visits your site, scheduled tasks won’t run. This design works well for most sites but can break down on low-traffic sites or when certain settings interfere.

Key uses of WordPress cron jobs include:

Technician with laptop working on server rack at NERSC.jpg
Photo: Derrick Coetzee from Berkeley, CA, USA / CC0 (Wikimedia Commons)
  • Publishing scheduled posts
  • Checking for plugin and theme updates
  • Clearing caches
  • Sending email notifications

Common Causes Why Cron Jobs May Not Run

  1. DISABLE_WP_CRON Set to True

    Some administrators disable WP-Cron by adding define('DISABLE_WP_CRON', true); in wp-config.php to rely on server cron instead. If server cron jobs are not properly configured, WP-Cron activity ceases.

  2. No Site Visitors

    If the front-end is not accessed, WP-Cron isn’t triggered. Low or no traffic sites often suffer from skipped cron events.

  3. Caching Plugins or Server Caches

    Caching plugins or aggressive server caches may prevent WordPress PHP code execution, including WP-Cron triggers.

  4. Blocking by Security Plugins or Firewall

    Security measures can block internal loopback requests that WP-Cron relies on.

  5. Fatal PHP Errors

    If a Cron job callback triggers PHP fatal errors, it can stop the WP-Cron system.

How to Diagnose WordPress Cron Issues

Follow this systematic approach to identify the root cause:

  1. Check if WP-Cron Is Disabled

    Open wp-config.php and look for DISABLE_WP_CRON. If true, ensure a real server cron job is properly set up to call WP-Cron.

  2. Manually Trigger WP-Cron

    Visit yourdomain.com/wp-cron.php?doing_wp_cron in a browser to force cron execution. If errors appear, investigate PHP errors via logs.

  3. Temporarily Disable Caching and Security Plugins

    Deactivate caching and security plugins momentarily to see if WP-Cron runs correctly afterward.

  4. Verify Loopback Requests

    Use plugins like Health Check & Troubleshooting to verify if loopback requests succeed. Failures here block WP-Cron.

  5. Enable Debug Logging

    Edit wp-config.php to add:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Check wp-content/debug.log for errors related to cron callbacks.

Practical Steps to Fix WP-Cron Issues

  1. If WP-Cron Is Disabled Without Server Cron Job

    Either remove the DISABLE_WP_CRON setting or set up a real cron job on your server. For example, add this line to your crontab to run every 15 minutes:

    */15 * * * * curl -s https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
  2. Set Up Real Cron Instead of WP-Cron

    Because WP-Cron depends on visits, real server cron is more reliable, especially for low-traffic sites:

    1. Set define('DISABLE_WP_CRON', true); in wp-config.php.
    2. Configure your server cron job (example above).
  3. Whitelist Loopback Requests

    Ensure your firewall and security plugins allow requests to http://localhost or your domain to prevent blocking WP-Cron.

  4. Temporarily Disable Caching

    Clear and disable caching plugins to check if cron resumes. Add exceptions or exclude wp-cron.php from caching.

  5. Fix PHP Errors in Cron Tasks

    Check the debug logs and plugin/theme conflicts causing fatal errors during cron callbacks. Disable problematic plugins or fix code.

  6. Use Debug Plugins

    Plugins such as WP Crontrol allow you to view pending cron events, run them manually, and delete stale events.

Limitations and Considerations

  • WP-Cron Only Works on Site Visits: For sites with no visitors, relying solely on WP-Cron is unreliable.
  • Server Cron Setup Varies: Access to server cron requires hosting control panel or SSH. Shared hosts may limit cron capabilities.
  • Security Risks: Avoid exposing cron URLs publicly without security measures.
  • Plugin Interferences: Some plugins modify cron behavior; test changes in staging environments before production.

Implementing server-based cron jobs and carefully managing plugins and caching generally resolves the majority of WP-Cron issues.

Featured photo credit: Gwydion M. Williams / CC BY 4.0 (Wikimedia Commons).

Scroll to Top