In this article, learn how to How to bulk delete woocommerce products by running simple SQL command through PhpMyAdmin.
How to bulk delete woocommerce products | Woocommerce bulk delete SQL script
Please follow the below steps to bulk delete woocommerce products by running simple SQL command through PhpMyAdmin. Please take the backup of your database before proceeding to bulk delete products from your woocommerce database.
- Login to your CPanel and open the PhpMyAdmin application
- Select your database. Once the database is selected, select the wp_posts table. (Note: wp_post is the default post table name. If you have changed the table prefix during wordpress installation, the name will be different. For example, abwp_999post
- Once the wp_post table is selected, selet the SQL tab in the PHPMyAdmin
- Enter the following script in to the SQL text box.
. DELETE relations.*, taxes.*, terms.* FROM wp_term_relationships AS relations INNER JOIN wp_term_taxonomy AS taxes ON relations.term_taxonomy_id=taxes.term_taxonomy_id INNER JOIN wp_terms AS terms ON taxes.term_id=terms.term_id 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';
How to bulk delete woocommerce media?
How to bulk delete woocommerce products using WordPress plugin?
– Article ends here –