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


4 Answers 4


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.

  • Thank you for the hint with the ?doing_cron parameter.
    – Roman
    Commented Mar 31, 2011 at 19:11
  • 3
    I believe it should be ?doing_wp_cron instead of ?doing_cron.
    – liviucmg
    Commented Apr 23, 2015 at 10:14
  • @liviucmg Yes, you're right. I've made the tweak.
    – Simon East
    Commented Aug 4, 2015 at 5:14
  • 1
    Is the ?doing_wp_cron parameter required? See EasyCron's manual set up tutorial.
    – Alec Rust
    Commented Sep 3, 2016 at 11:25
  • @gabrielk Is the ?doing_cron parameter required? what does it mean?
    – jedi
    Commented Feb 23, 2017 at 9:31

You could debug manually, by creating an action and executing the Cron action inside. Like this:

add_action( 'init', function() {

    if ( ! isset( $_GET['the_cron_test'] ) ) {

    error_reporting( 1 );

    do_action( 'this_is_cron_event_hook' );


} );

And by going to your website's address: http://example.com?the_cron_test

This should show you any errors with the cron task.

But it's without any sense doing it manually. You could use Advanced Cron Manager PRO plugin which does this for you and also saves the log and other stats.

  • This is the best method, as the ones outlined above (and below) do not show any output.
    – Ciprian
    Commented Sep 15, 2021 at 12:29

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');

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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