Skip to content

Instantly share code, notes, and snippets.

@lukecav
Forked from BronsonQuick/gist:5185918001f4df5c5d15
Last active January 22, 2021 13:07
Show Gist options
  • Save lukecav/57d60f178eb1f1501901c1554bda923b to your computer and use it in GitHub Desktop.
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
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