Last active
June 6, 2023 20:50
-
-
Save lukecav/ececebffbd41a9302af20c103c009925 to your computer and use it in GitHub Desktop.
Delete all Action Scheduler posts using WP-CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp post delete $(wp post list --post_type='scheduled-action' --format=ids) | |
wp post delete $(wp post list --post_status=trash --format=ids) |
`DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'failed'`
`DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'canceled'`
`DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'complete'`
`DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'pending'`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.wordpress.org/cli/commands/post/delete/
https://github.com/Prospress/action-scheduler
https://docs.woocommerce.com/document/automated-follow-up-emails-docs/faq/#section-3