6

say this:

wp post delete --force $(wp post list --post_type=product --format=ids)

I found out that it's far more fast and performant than deleting posts from admin.

But I was wandering: any differences between the cli and admin ways? For example, will that cli command also delete metadata associated with deleted posts?

1
  • 3
    They both call the same functions internally, but one way to test this is to just do it and check if the post meta is still present
    – Tom J Nowell
    Nov 25, 2019 at 15:51

1 Answer 1

4

In short, yes. However, if you run into an issue like custom fields or media hanging around, you could use:

wp post meta delete

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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