Skip to navigation
How to move in batch WooCommerce order into trash with the wp-cli command
09.02.25
```bash for id in $(wp db query "SELECT id FROM wp9735posts WHERE post_date < '2017-02-01' AND post_type='shop_order'" --skip-column-names --allow-root | grep '.*[0-9]' -o); do wp wc shop_order delete $id --user=1 --force=1 --allow-root; done ```
https://do.that.ee/wp-cli-delete-orders-older-than/
Reply
Anonymous
the above commend does not move the orders to trash, it deletes them permanently
09.02.25
Reply
Anonymous
Information Epoch 1740243666
Use lower case and keep it short.
Home
Notebook
Contact us