3

I would like to know how to bulk delete posts from a specific category using the WP-CLI, any tip?

9

This should delete all posts in your category:

wp post delete $(wp post list --cat=your_category_ID --format=ids)

Or directly:

wp db query [<your_sql_query>]

For more info:

wp post delete --help
wp post list --help
wp db query --help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.