Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

[SOLVED] How to Delete Action Scheduler Cron Job

$
0
0

Replies: 0

Dear Community,

Many of you have been wondering how to delete the pesky action_scheduler_run_queue cron job from your website.

The cron job runs every minute and is triggered when someone visits your website. Also, the cron job is used mainly to support WooCommerce websites. So, if you are not running a WooCommerce website or are not using plugins that depend on WooCommerce, it is quite safe to delete it.

To delete the cron job, add the following code snippet to your functions.php file: (you can add it via the plugin, Code Snippets)

Code Snippet:

add_action("init", "remove_cron_job"); 
  function remove_cron_job() {
	wp_clear_scheduled_hook('action_scheduler_run_queue', array('WP Cron'));
}

Useful Tips:

(1) Prior to deleting the cron job, make a backup of your website.

(2) You can confirm the cron job has been deleted via the plugin, WP Crontrol.

(3) To understand better what Action Scheduler is used for, please visit:

https://actionscheduler.org

(4) The code snippet provided above was developed based on information shared by these websites:

https://w3guy.com/remove-wordpress-plugin-cron-job/
https://developer.wordpress.org/reference/functions/wp_clear_scheduled_hook/

Hoping the above will help many. Cheers!


Viewing all articles
Browse latest Browse all 59525

Trending Articles