- Log in to the
phpMyAdmin
portal - Select the database that has all the products to be deleted. Make sure, that you backup your database before executing the SQL statement!
- Than select table
{prefix}_posts
and run the SQL statement as shown.
DELETE relations.*, taxes.*, terms.*
FROM metro4u_term_relationships AS relations
INNER JOIN metro4u_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN metro4u_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_postmeta WHERE post_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_posts WHERE post_type IN ('product','product_variation');
Note: "metro4u" is a prefix. Set your Database Table prefix
No comments:
Post a Comment