add_filter( 'cron_schedules', 'cron_add_5min' ); function cron_add_5min( $schedules ) { $schedules['5min'] = array( 'interval' => 5*60, 'display' => __( 'Once every five minutes' ) ); return $schedules; } if ( ! wp_next_scheduled( 'my_task_hook' ) ) { wp_schedule_event( time(), '5min', 'my_task_hook' ); } add_action( 'my_task_hook', 'do_stuff' ); function do_stuff(){ // do stuff }