Skip to content

Instantly share code, notes, and snippets.

@tuongpgjz
Created October 20, 2021 07:39
Show Gist options
  • Save tuongpgjz/585383373f7f399620176a08beb33071 to your computer and use it in GitHub Desktop.
Save tuongpgjz/585383373f7f399620176a08beb33071 to your computer and use it in GitHub Desktop.
Clean orders on your store
-- This SQLs remove orders, orders notes, customers, coupons on your store
-- SalesGen.io
-- NOTICE: Replace wp_ by your prefix table
DELETE FROM wp_woocommerce_order_itemmeta;
DELETE FROM wp_woocommerce_order_items;
DELETE FROM wp_wc_order_stats;
DELETE FROM wp_wc_order_product_lookup;
DELETE FROM wp_wc_order_coupon_lookup;
DELETE FROM wp_wc_customer_lookup;
DELETE FROM wp_woocommerce_sessions;
DELETE FROM wp_comments WHERE comment_type = 'order_note';
DELETE FROM wp_posts WHERE post_type = 'shop_order';
DELETE FROM wp_posts WHERE post_type = 'shop_coupon';
DELETE FROM wp_posts WHERE post_type = 'shop_order_refund';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment