From time-to-time, you may need to bulk delete a set of actions scheduled with Action Scheduler.
This can be done using the following SQL queries:
Delete Schedule Actions
DELETE FROM `wp_posts` WHERE `post_type` = 'scheduled-action' AND `post_title` = 'hook_name'
Delete Orphaned Meta
The above query will delete scheduled actions but not their associated meta, so we need to handle that separately with this query:
DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL
Delete Orphaned Log Entries
DELETE comments FROM wp_comments AS comments LEFT JOIN wp_posts wp ON wp.ID = comments.comment_post_ID WHERE wp.ID IS NULL
Recent Comments