5

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?

  • 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 '19 at 15:51
3

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

wp post meta delete
| improve this answer | |

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.