Last active
February 3, 2022 09:50
-
-
Save dvdmierden/e26ee54399a485d58bb2f36f7086fa13 to your computer and use it in GitHub Desktop.
Woocommerce clear orders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM wp_woocommerce_order_itemmeta; | |
DELETE FROM wp_woocommerce_order_items; | |
DELETE FROM wp_comments WHERE comment_type = 'order_note'; | |
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_order' ); | |
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_subscription' ); | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; | |
DELETE FROM wp_posts WHERE post_type = 'shop_subscription'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment