Skip to content

Instantly share code, notes, and snippets.

@TimBHowe
Last active January 31, 2017 12:47
Show Gist options
  • Save TimBHowe/44f54faa1698e6f62400 to your computer and use it in GitHub Desktop.
Save TimBHowe/44f54faa1698e6f62400 to your computer and use it in GitHub Desktop.
Remove all orders from WordPress WooCommerce. This is ideally for clearing out orders on a staging/beta version of a WooCommerce site where the order information is not needed or should not be stored.
DELETE FROM wp_postmeta
WHERE post_id IN(SELECT ID FROM wp_posts WHERE post_type = 'shop_order');
DELETE FROM wp_posts WHERE post_type = 'shop_order';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment