Remove all (ghost) product through SQL
-
Hi
I try to run the command below in my SQL database to remove all ghost products that gets back at random after I try to delete them. But this command crashes my database. Whats wrong?
gfzc is my table name.DELETE relations.*, taxes.*, terms.* FROM gfzc_term_relationships AS relations INNER JOIN gfzc_term_taxonomy AS taxes ON relations.term_taxonomy_id=taxes.term_taxonomy_id INNER JOIN gfzc_terms AS terms ON taxes.term_id=terms.term_id WHERE object_id IN (SELECT ID FROM gfzc_posts WHERE post_type=’product’);# 421 rows affected. DELETE FROM gfzc_postmeta WHERE post_id IN (SELECT ID FROM gfzc_posts WHERE post_type = ‘product’);# 3131 rows affected. DELETE FROM gfzc_posts WHERE post_type = ‘product’;# 129 rows affected.
The topic ‘Remove all (ghost) product through SQL’ is closed to new replies.