Title: Pointer to &#8216;safe&#8217; SQL DELETE STATEMENT
Last modified: March 10, 2024

---

# Pointer to ‘safe’ SQL DELETE STATEMENT

 *  Resolved [g_dub](https://wordpress.org/support/users/g_dub/)
 * (@g_dub)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/pointer-to-safe-sql-delete-statement/)
 * Hi
 * Taking over from another dev, who built a custom plugin that integrates with 
   Woocommerce Subscriptions (and of course Woocommerce Orders). I’m looking for
   a safe SQL DELETE (I’ve used `wp cli` but it’s very slow) to delete all customer
   orders and subscriptions from my local environment.
 * I can easily create a local environment based upon PROD (e.g. repoint to my `*.
   devel` URI and repoint all URL in the DB) and want to keep the products (as defined
   in PROD) but delete all the ‘real’ orders & subscriptions.
 * I’m used to a ‘set up’ and ‘tear down’ script for WP sites (i.e. import products),
   and a TEST/STAGING environment but this one has neither. Thanks for any pointers..

Viewing 1 replies (of 1 total)

 *  Thread Starter [g_dub](https://wordpress.org/support/users/g_dub/)
 * (@g_dub)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/pointer-to-safe-sql-delete-statement/#post-17487794)
 * ah.. darn.. nvr mind.. found it at:
 * [https://wp-staging.com/docs/delete-all-woocommerce-orders-and-transactions/](https://wp-staging.com/docs/delete-all-woocommerce-orders-and-transactions/)

Viewing 1 replies (of 1 total)

The topic ‘Pointer to ‘safe’ SQL DELETE STATEMENT’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/xa-woocommerce-subscriptions_07c0d4.
   svg)
 * [Subscriptions for WooCommerce](https://wordpress.org/plugins/xa-woocommerce-subscriptions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/xa-woocommerce-subscriptions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/xa-woocommerce-subscriptions/)
 * [Active Topics](https://wordpress.org/support/plugin/xa-woocommerce-subscriptions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/xa-woocommerce-subscriptions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/xa-woocommerce-subscriptions/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [g_dub](https://wordpress.org/support/users/g_dub/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/pointer-to-safe-sql-delete-statement/#post-17487794)
 * Status: resolved