How to Delete All Products From WooCommerce

Delete All Products From WooCommerce

Are you looking for a way to delete all products from WooCommerce? WooCommerce continues to power many online stores because it is packed with many features. It allows you to sell anything online.

However, if you are a store owner, you need to be vigilant. This is because you need to be aware of everything to keep the store updated with the best-selling products.

You need to know what’s trending and the season for selling certain products.

When it comes to selling seasonal products, you may need to delete the ones that are not sold for the time being.

This is because they are relevant only for a specific period.

In some cases, you may run out of stock, and there isn’t any likelihood of the same returning in stock. You need to remove these products from your store.

How to Delete All Products From WooCommerce

In this post, we will show you how it is very easy to delete all the products from your store.

It is important to note that WooCommerce has a built-in solution to do this. This makes it easy for beginners to delete products in a few clicks.

Read on, as we will also provide a more complex solution for developers.

Steps to Delete All Products From WooCommerce

It is not complicated to delete all the products from your store. Here are the steps you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Products > All Products.
  3. Select products one by one.
  4. Alternatively, you can apply filters based on category, stock status, and product type.
  5. Click on Bulk Actions and select Move to Trash.move to trash

However, if you have many products, this process can be very tedious if you have hundreds of products.

You can run an SQL command to bulk delete products.

Here are the steps you need to follow:

  1. Log in to the phpMyAdmin portal
  2. Select the database that has all the products to be deleted. Make sure, that you back up your database before executing the SQL statement!
  3. Then select table “wp_posts” and run the SQL statement as shown below:
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');


This command will remove all the products.

Conclusion

By now, you should be able to delete all the products from your store. WooCommerce makes it very easy to remove many products at once.

However, if you are comfortable with handling code, we recommend running an SQL command. It will save you a lot of time.

You can also use a plugin to achieve the same result.

If you encounter any problems implementing the code, please contact a qualified WordPress developer.

Similar Articles

  1. How to Edit Billing Details WooCommerce Checkout Page
  2. How to Add Search to Shop Page In WooCommerce
  3. How to Add Select Field to Checkout WooCommerce