In this tutorial, I will show you how to delete all Woocommerce products with just a few clicks quickly and safely without any trouble.
The deletion of all Woocommerce products is becoming complicated and time-consuming if you upload thousands of products to Woocommerce through CSV and then you want to delete all Woocommerce products, categories, tags, attributes, and brands for some reason.
I hope this tutorial will cover all your doubts and queries that you have in your mind:
How to delete all Woocommerce old products?
How to delete all the products images?
How to delete all the old products categories, brands, and tags?
How to delete all Woocommerce products through the Website MYSQL database?
Do you want to know an easy way to delete all Woocommerce products, categories, brands, and tags with a few clicks?
- I will show you three simple and easy steps to delete all products from your store. Using the default Woocomerce interface – good for less number of products.
- Running an SQL command in MySQL database – Required Technical skills.
- Using the plugin – Smart Manager – provides an interface to delete all Woocommerce products quickly without having any technical skills.
1. Using the default Woocomerce interface – good for less number of products
If you upload products for testing or any other reason and is less than a few hundred, this method is suitable to go with and delete the products from your store.
- Login to your WordPress admin dashboard
- Go to ‘ Woocommerce> Products’
- Choose the ‘Screen Option’ on the top – to increase the number of products
- Select product one by one – filter according to your needs and requirements if you want.
- Select ‘Bulk Actions’ click on ‘Move to Trash’
Note: This method is too slow and tedious if there are thousands of products in your store.
To delete products permanently you need to delete the products from the trash.
2. Running an SQL command in MySQL database – Required Technical skills
Another approach to delete all Woocommerce products is through SQL commands which help to delete thousands of products in a few seconds.
In this approach make sure you back the website database if you run the SQL commands in case of any trouble in the database that you restore your database again.
- Login to your website ‘Cpanel‘ where your website files are stored.
2. Go to your domain root directory and find ‘config.php’. In ‘config.php’ you will see your database name.
3. Go to ‘PhpMyAdmin’ choose the ‘database‘ on which you want to execute the SQL queries.
Copy and paste the first script.
DELETE a,c FROM wp_terms AS a LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'product_tag'; DELETE a,c FROM wp_terms AS a LEFT JOIN wp_term_taxonomy AS c ON a.term_id = c.term_id LEFT JOIN wp_term_relationships AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'product_cat'
Copy and paste the second script.
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';
After the successful execution of SQL statements all the products, categories, tags, and brands will be deleted.
Delete all the product images
In this approach, the images of the products are not deleted for this we will use a media cleaner plugin to clean all media libraries from unused images.
3. Using the plugin – Smart Manager – provides an interface to delete all Woocommerce products quickly without having no technical skills
Smart Manager is a Woocommerce plugin that gives you an easy interface just like an Excel-like Spreadsheet to manage Woocommerce products by doing all bulk editing- add/ delete/ update operations.
Smart Manager is a pro plugin that provides multiple filters to filter the product according to your needs and requirements and delete products.
- Go to WP Admin > Smart Manager and select Products as the post type from the dropdown.
- You can use advanced search to find out your product quickly.
- Click on delete it will show you two options Move to Trash and Delete Permanently, choose your desired option.
The deletion of Woocommerce products is very tedious if you have hundreds or thousands of products and you want to update continuously your store with new products and you need to delete all the old products from your store just a few click in an intelligent way, this tutorial show you how to delete all the Woocommerce products in very quickly in few click with all possible approaches Super-easy and super-quick.