Delete all scheduled events with a particular hook
4.9.0 introduced wp_unschedule_hook() https://developer.wordpress.org/reference/functions/wp_unschedule_hook/
4.9.0 introduced wp_unschedule_hook() https://developer.wordpress.org/reference/functions/wp_unschedule_hook/
WP Cron runs, when somebody visits your website. Thus if nobody visits, the cron never runs. Now there are 2 solutions: Disable WP Cron, use a real cron job and customize it. https://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job Use a custom interval in wp_schedule_event(): function myprefix_custom_cron_schedule( $schedules ) { $schedules[‘every_six_hours’] = array( ‘interval’ => 21600, // Every 6 hours ‘display’ … Read more
WordPress has a constant DOING_CRON that helps us know we’re doing the cron jobs or not. It’s defined in wp-cron.php file. So, you can check this constant in your code: if ( defined( ‘DOING_CRON’ ) ) { // Do something }
Thanks Privateer for the prompt reply and advice. I found a way around it before I saw your answer. Here is a step-by-step method for deleting thousands of old cron jobs and may be of use to someone else. I logged on to phpMyAdmin. I clicked on my database and then the ‘search’ tab. I … Read more
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 … Read more
This can happen if curl is asked to do plain HTTP on a server that does HTTPS. Example: