WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I debug problems with WordPress Cron? I think it will trigger when users go to your site but any errors wont be shown to them, as the jobs are run "asynchronously". So how might I debug errors?

I use wp schedule event

share|improve this question
up vote 21 down vote accepted

You can run WP cron manually by calling: http://example.com/wp-cron.php?doing_wp_cron

If you don't want the automatic cron to run while you're debugging, then add this to your /wp-config.php file:

define('DISABLE_WP_CRON', true);

If you're on a development environment and want to output debug information, calling it manually like that will show you your debug output.

Alternatively you can use PHP's built-in error_log function to log message strings to the error log for debugging. You'd need to use this in conjunction with WP_DEBUG settings, as mentioned by Rarst.

share|improve this answer
Thank you for the hint with the ?doing_cron parameter. – rofflox Mar 31 '11 at 19:11
I believe it should be ?doing_wp_cron instead of ?doing_cron. – liviucmg Apr 23 '15 at 10:14
@liviucmg Yes, you're right. I've made the tweak. – Simon East Aug 4 '15 at 5:14

You could use the plugin Cron-View. There you can see if your job is a) registered and b) what the next due time is.

In addition, you could add a lower schedule-timer to your event (e.g. every 2 min) and test your method more frequently on a local system. Use the 'cron_schedules' filter hook to register new schedule times. For example:

function my_additional_schedules($schedules) {
    // interval in seconds
    $schedules['every2min'] = array('interval' => 2*60, 'display' => 'Every two minutes');
    return $schedules;
add_filter('cron_schedules', 'my_additional_schedules');
share|improve this answer

You can (and probably should in any case, cron or not) configure PHP error log to capture all errors.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.