Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krogsgard/4198574c3c5294efc380357673e03b6a to your computer and use it in GitHub Desktop.
Save krogsgard/4198574c3c5294efc380357673e03b6a to your computer and use it in GitHub Desktop.
This WP CLI command deletes all comments on a post with ID of "123". You can do other things, like add a "status=spam" or whatever to the comment list command as well.
wp comment delete $(wp comment list --post_id=123 --format=ids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment