-
-
Save lukecav/57d60f178eb1f1501901c1554bda923b to your computer and use it in GitHub Desktop.
Delete ActionScheduler comments and scheduled-action post types in WooCommerce 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 comment list --field=comment_ID --'comment_author'='ActionScheduler' --number=1000 | xargs wp comment delete --force | |
wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 | xargs wp post delete --force | |
wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 --post_status=trash | xargs wp post delete --force | |
wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 --post_status=cancel | xargs wp post delete --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.wordpress.org/cli/commands/comment/list/
https://developer.wordpress.org/cli/commands/comment/delete/
https://developer.wordpress.org/cli/commands/post/list/
https://developer.wordpress.org/cli/commands/post/delete/
https://www.liquidweb.com/kb/delete-posts-comments-action-scheduler/