How to Delete All Products From WooCommerce in 3 Safe Ways

bulk delete all woocommerce products using code and plugin

How to Delete All Products From WooCommerce in 3 Safe Ways

Deleting all products from a WooCommerce store is sometimes necessary when you want to clean a test store, remove outdated inventory, rebuild your product catalog, or import a fresh product list. But this task should be done carefully because WooCommerce products can be connected to orders, variations, categories, images, reviews, and other store data.

There are several ways to delete all WooCommerce products. You can use the default WooCommerce bulk actions, run SQL queries from the database, or use PBULKiT – Bulk Edit WooCommerce Products to select, filter, move to trash, or permanently delete products in bulk.

In this tutorial, we’ll walk through 3 safe methods to remove all products from WooCommerce. You’ll also learn what to check before deleting products, when to use each method, and how to avoid common mistakes that can affect your store data.

How to prepare your website to delete all WooCommerce products?

Before you delete all products from WooCommerce stores, it is important to consider the possible consequences. First of all, note that removing all products will also target orders related to them. Another concern is the removal of product dependencies, which may not be your main goal of removing WooCommerce products.

To avoid these possible consequences, consider the following two points before removing all WooCommerce products:

Back up the site information before deleting all products

It is better to back up essential information such as WooCommerce orders, customer reviews, product images, and product dependencies.

Collect important information before removing all products

If your products are linked to other data such as customers, orders, or reviews, it is important to check for possible dependencies. For example, if you remove products that have already been purchased by customers. You may lose your loyal customers who used to visit your site to buy that product.

WooCommerce delete all products manually

The easiest way to bulk delete WooCommerce products is to remove them manually through the WooCommerce product bulk edit page. This is an efficient method for online stores with a relatively small volume of products.

First, go to the “Products » All Products” section in the WordPress dashboard.

By default, WooCommerce displays 20 products per page. If the number of products available on your site is more, find the screen options tab in the upper right corner and click on it.

click screen options to change number of items per page
For delete all WooCommerce products you must change default product per page value to a large number

Now, in the pagination section, set the “Number of items per page” option so that all the products you have are displayed on one page. Finally, click on “Apply”.

Set products per page value
change number of items per page

Now, all products can be viewed on one page and you can select them all by checking the checkbox under the bulk actions window. If you want to select only certain products, you have to check them one by one. Keep in mind that you can apply different filters to target specific products or product groups.

select bulk action in woocommerce product list
Select move to trash to delete all selected products in the list

After selecting the products to be deleted, return to the “Bulk Actions” box and select the “Move to Trash” option. Then click on the Apply button.

It’s important to note that even though we’ve moved the products to the trash, they haven’t been completely removed yet. To complete the bulk delete process, go to “Trash” and again select all products through the checkbox and delete them.

Delete WooCommerce products from database via SQL

As you may notice, bulk remove products via WooCommerce product bulk edit manually, is very inefficient in online stores with a large number of products. Time is of the essence in web development, and wasting precious time ticking thousands of checkboxes is a tedious way to do it. Fortunately, this problem can be solved using code.

For delete all WooCommerce product via SQL, you must first enter your host Cpanel and go to “phpMyAdmin” as shown in the image below.

Select phpmyadmin in cpanel
Select phpMyAdmin in cPanel home page

After entering “phpMyAdmin“, you will see the image below, where you can enter the name of your database from the left and then click on “wp-post” from the window that opens.

Select WordPress database in phpmyadmin
Select WordPress database in phpMyAdmin
select wp_posts database in phpmyadmin
Select wp_posts table to access all WordPress posts and products

After entering this section, you will see the image below on the left side. Please note that in some Cpanels, there is a “Go” button on the right side of the image, and you can apply it by entering the desired code.

Otherwise, you have to click on “Console” and apply the code there and then press “Ctrl+Enter”.

Select console in SQL tab of phpmyadmin
Click on “Console” to write SQL code for deleting all products in WooCommerce

To execute WooCommerce delete all products, you can enter one of the following codes according to your needs in this section:

Bulk delete all WooCommerce simple products

The following code is for deleting all WooCommerce simple products!

Copy and paste the following code in the indicated section and then press “Ctrl+Enter” and wait for the code to be applied.

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';

Bulk remove all WooCommerce products and categories

The following code is for deleting all related products and categories in WooCommerce.

Copy and paste the following code in the indicated section and then press “Ctrl+Enter” and wait for the code to be applied.

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';
DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;
delete from `wp_termmeta`
where
	`term_id` in (
		SELECT `term_id`
		FROM `wp_term_taxonomy`
		WHERE `taxonomy` in ('product_cat', 'product_type', 'product_visibility')
	);
delete from `wp_terms`
where
	`term_id` in (
		SELECT `term_id`
		FROM `wp_term_taxonomy`
		WHERE `taxonomy` in ('product_cat', 'product_type', 'product_visibility')
	);
DELETE FROM `wp_term_taxonomy` WHERE `taxonomy` in ('product_cat', 'product_type', 'product_visibility');
DELETE meta FROM wp_termmeta meta LEFT JOIN wp_terms terms ON terms.term_id = meta.term_id WHERE terms.term_id IS NULL;
DELETE FROM wp_woocommerce_attribute_taxonomies;
DELETE FROM wp_woocommerce_sessions;

WooCommerce delete all products with variations and taxonomies

The following code is for deleting all products with variations and taxonomies in WooCommerce.

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 IN ('product','product_variation'));
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM wp_posts WHERE post_type IN ('product','product_variation');

Bulk remove all WooCommerce product taxonomies

If you want to remove only the attributes, you can run the following code.

DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%');
DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%';
DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy);

After running each of these codes, go back to your WordPress dashboard and check if your products have been removed. If you get an error after running the SQL statement, make sure you’ve replaced all prefixes correctly with wp.

Note that the above code deletes all WooCommerce products. If you are not familiar with coding, be sure to back up your data or use the next method we are introducing which is using one of the best  WooCommerce product bulk edit plugins.

How to use the WooCommerce product bulk edit plugin to bulk remove all products in your online store?

To bulk remove all WooCommerce products using the WooCommerce product bulk edit plugin, first download, install and launch the plugin, after activation, the plugin will be automatically added to the WordPress dashboard.

PBULKiT - Bulk Edit WooCommerce Products plugin by ithemeland

Then you can run this plugin to see the list of products displayed as a table. To bulk delete all products, you must first display all of them in the product table of this plugin. For this, just set the pagination box to 100.

Then mark the checkbox next to the ID option so that all products are selected.

Change number of items in woocommerce bulk product editing plugin
Change number of items in WooCommerce bulk product editing plugin

After selecting the products, the “Delete” button will be displayed to you, if you click on it, you will see the following two options:

  • Move to trash.
  • Delete products permanently.
delete selected products in woocommerce bulk product editing plugin
Delete all selected products in WooCommerce bulk product editing plugin

If you don’t want to delete all the products, click on the “Permanently” option. In this way, all the products are completely deleted and there is no possibility of restoring them.

But if you think that in the future you may need the products to be added to your store again, click on the “Move to Trash” option. In this way, the trash option is displayed on the top of the table, if you click on it, you will see the deleted products and you can restore them to your store whenever you want.

PBULKiT - Bulk Edit WooCommerce Products plugin by ithemeland

Conclusion

Deleting all WooCommerce products can save a lot of time when you need to reset a store, remove old products, or prepare your catalog for a new import. The default WooCommerce bulk action is useful for smaller stores, while SQL can be faster for technical users who are comfortable working with the database.

However, deleting products directly from the database is risky if you are not sure what the query will remove. It can affect variations, product meta, taxonomies, and other connected data. That is why it is always better to create a full backup before using any bulk delete method.

For most store owners, PBULKiT – Bulk Edit WooCommerce Products provides a more practical way to bulk delete WooCommerce products. You can review products in a table, select the items you want to remove, choose between moving them to trash or deleting them permanently, and manage product cleanup without editing each product manually.

FAQ

1. How do I delete all products from WooCommerce?

You can delete all WooCommerce products from Products > All Products by selecting products, choosing Move to Trash from the Bulk Actions dropdown, and applying the action. For larger stores, PBULKiT – Bulk Edit WooCommerce Products can make the process faster and easier to control.

2. Can I bulk delete WooCommerce products without using SQL?

Yes. You can use WooCommerce’s default bulk action to move products to trash, or use PBULKiT to delete products in bulk from a product table. SQL is not required unless you want to remove products directly from the database.

3. Is it safe to delete all WooCommerce products?

It can be safe if you create a backup first and understand what data will be removed. Products may be connected to orders, variations, images, categories, reviews, and metadata, so you should not delete them without checking the impact.

4. What is the difference between moving products to trash and deleting them permanently?

Moving products to trash keeps them recoverable, so you can restore them later if needed. Permanent deletion removes products completely and cannot be easily reversed unless you have a backup.

5. Can I delete only selected WooCommerce products instead of all products?

Yes. You can filter or manually select specific products before deleting them. This is useful when you only want to remove products from a category, outdated items, test products, or imported products with incorrect data.

6. Can I remove all WooCommerce products with variations?

Yes, but you need to be careful. Variable products include parent products and product variations. If you use SQL or bulk delete tools, make sure the method also handles variations correctly, otherwise some product data may remain in the database.

7. Should I use SQL to delete all WooCommerce products?

SQL can be fast, but it is risky for non-technical users. A wrong query can delete more data than expected or leave broken records behind. If you are not comfortable with database operations, using PBULKiT is usually a safer option.

8. What should I do before deleting all WooCommerce products?

Before deleting products, back up your website and database, check if products are connected to orders or reviews, decide whether you want to move products to trash or delete them permanently, and test the process on a small number of products first.

Related Articles

You might also be interested in these articles

Reader Comments

Join the conversation and share your thoughts

Leave a Reply

Start Your Journey

Sign in / Sign up account to continue