Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active June 12, 2022 20:59
Show Gist options
  • Save lukecav/646da8142102615e0aeffe75538d9f83 to your computer and use it in GitHub Desktop.
Save lukecav/646da8142102615e0aeffe75538d9f83 to your computer and use it in GitHub Desktop.
Delete all comments marked as hold and spam using WP-CLI
wp comment delete $(wp comment list --status=hold --format=ids)
wp comment delete $(wp comment list --status=spam --format=ids)
@davemac
Copy link

davemac commented Mar 12, 2019

I think this should use status=hold as per WP Comment Query

wp comment delete $(wp comment list --status=hold --format=ids) works for me.

@tienloc1
Copy link

I think this should use status=hold as per WP Comment Query

wp comment delete $(wp comment list --status=hold --format=ids) works for me.

@davemac thank you so much, it's working fine for me.

@lukecav
Copy link
Author

lukecav commented Dec 14, 2020

K updated the WP-CLI commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment