1DELETE relations.*, taxes.*, terms.*
2FROM wp_term_relationships AS relations
3INNER JOIN wp_term_taxonomy AS taxes
4ON relations.term_taxonomy_id=taxes.term_taxonomy_id
5INNER JOIN wp_terms AS terms
6ON taxes.term_id=terms.term_id
7WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product');
8
9DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
10DELETE FROM wp_posts WHERE post_type = 'product';
11