Skip to content

Instantly share code, notes, and snippets.

@aradnom
Created March 28, 2014 16:33
Show Gist options
  • Save aradnom/9837085 to your computer and use it in GitHub Desktop.
Save aradnom/9837085 to your computer and use it in GitHub Desktop.
Clear all crons in WordPress. This is a nuclear option, so use with care.
// Pull all crons from options
$crons = get_option('cron');
// Kill each one. Filter by timestamp or hook_name if desired.
foreach ($crons as $timestamp => $hook) {
foreach ($hook as $hook_name => $details) {
wp_unschedule_event( $timestamp, $hook_name );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment