Skip to content

Instantly share code, notes, and snippets.

@wolffe
Created March 15, 2013 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolffe/5173213 to your computer and use it in GitHub Desktop.
Save wolffe/5173213 to your computer and use it in GitHub Desktop.
Remove all products from Woocommerce (SQL query)
DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
DELETE FROM wp_posts WHERE post_type = 'product';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment