Title: not able delete all products using cli
Last modified: February 19, 2021

---

# not able delete all products using cli

 *  Resolved [corus9](https://wordpress.org/support/users/corus9/)
 * (@corus9)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/not-able-delete-all-products-using-cli/)
 * i’ve 30k active products and 1k in trash, i want to delete all the products including
   trash.
 * for active products i’m trying this command :
 * `wp post delete $(wp post list --post_type='product' --format=ids) --force --
   allow-root`
 * but getting this in return :
 * `usage: wp post delete <id>... [--force] [--defer-term-counting]`
 * same for trash products : `wp post delete $(wp post list --post_status=trash --
   format=ids) --allow-root`
 * getting same error : `usage: wp post delete <id>... [--force] [--defer-term-counting]`
 * can anyone help me to figure out this issue
 * edit :
 * `wp wc product delete <id> --user=admin --allow-root`
 * while above command works fine but i want to delete products in bulk and this
   deletes single product only
    -  This topic was modified 5 years, 5 months ago by [corus9](https://wordpress.org/support/users/corus9/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Gabriel – a11n](https://wordpress.org/support/users/gabrielfuentes/)
 * (@gabrielfuentes)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/not-able-delete-all-products-using-cli/#post-14076634)
 * Hi there 👋
 * This is a fairly complex development topic. I’m going to leave it open for a 
   bit to see if anyone is able to chime in to help you out.
 * I can also recommend [the WooCommerce Developer Resources Portal](https://developer.woocommerce.com/)
   for resources on developing for WooCommerce.
 * You can also visit the [WooCommerce Facebook group](https://www.facebook.com/groups/advanced.woocommerce/)
   or the `#developers` channel of the [WooCommerce Community Slack](https://woocommerce.com/community-slack/).
   We’re lucky to have a great community of open-source developers for WooCommerce,
   and many of our developers hang out there, as well.
 * Cheers
 *  [Nicola Mustone](https://wordpress.org/support/users/nicolamustone/)
 * (@nicolamustone)
 * Automattic Happiness Engineer
 * [5 years, 4 months ago](https://wordpress.org/support/topic/not-able-delete-all-products-using-cli/#post-14137093)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘not able delete all products using cli’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Nicola Mustone](https://wordpress.org/support/users/nicolamustone/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/not-able-delete-all-products-using-cli/#post-14137093)
 * Status: resolved