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:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Products > All Products.
- Select products one by one.
- Alternatively, you can apply filters based on category, stock status, and product type.
- Click on Bulk Actions and select 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:
- Log in to the phpMyAdmin portal
- Select the database that has all the products to be deleted. Make sure, that you back up your database before executing the SQL statement!
- 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.
Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
Similar Articles
- WooCommerce Redirect After Logout [Ultimate Guide]
- 100+ Tips, Tricks & Snippets Ultimate WooCommerce Hide Guide
- WooCommerce Redirect After Checkout: Redirect to Custom Thank You Page
- How to Edit Billing Details WooCommerce Checkout Page
- How to Add Search to Shop Page In WooCommerce
- How to Set Up Free Shipping with Minimum Spend In WooCommerce
- How to Remove Product Category Title WooCommerce
- How to Create WooCommerce Custom Shop Page
- WooCommerce Difference Between PayPal and PayPal Checkout
- How to Force Secure Checkout In WooCommerce
- How to Hide Price When Out of Stock In WooCommerce
- How to Create WooCommerce Secret Product
- How to Add Product to Cart Programmatically in WooCommerce
- How to Remove Product Image Placeholder In WooCommerce
- 30+ Best WordPress Inventory Management Plugins
- How to Hide Quantity In Stock In WooCommerce
- How to Hide Unavailable Variations In WooCommerce
- How to Remove Phone Number Field From Checkout WooCommerce
- How to Select All Except Last Child In CSS » CSS Not Last Child Example
- How to Add Select Field to Checkout WooCommerce