function wp_clear_scheduled_hook( $hook, $args = array() {}

Unschedule all cron jobs attached to a specific hook.


  • string $hook: Action hook, the execution of which will be unscheduled.
  • array $args: Optional. Arguments that were to be pass to the hook’s callback function.

Source code

function wp_clear_scheduled_hook( $hook, $args = array() ) {

	// Backward compatibility

	// Previously this function took the arguments as discrete vars rather than an array like the rest of the API

	if ( !is_array($args) ) {

		_deprecated_argument( __FUNCTION__, '3.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );

		$args = array_slice( func_get_args(), 1 );


	while ( $timestamp = wp_next_scheduled( $hook, $args ) )

		wp_unschedule_event( $timestamp, $hook, $args );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: