WordPress

What is the best way to delete all products in WooCommerce?

Step-by-Step Guide for New WordPress Users on How to Correctly Uninstall Plugins in WordPress

To understand why you would need to delete products from your WooCommerce store, let us first highlight why you would want to delete them in the first place.

Imported Products are not accurate

Let’s say you imported products for a supper market, and that is more than twenty thousand. You have found that most products didn’t import with the accurate price, the SKU is incorrect, or something else. And you found actual errors in the CVS file.

In this scenario, fix the CVS file and import again. To do that, you need to delete all the existing products.

Products with a cyclical nature

Every primary season, inventory is replenished with new clothing items. The old stock must be deleted so it will no longer be available.

Non-selling items

To avoid expenditures on unsold inventory, you should dispose of products that aren’t selling.

How to Delete All Products in WooCommerce?

Using the default WooCommerce setting and calling an SQL command, we will show you how to delete all products from your WooCommerce store in this part.

Method 1: Using the default WooCommerce setting

Step 1: Go to WooCommerce > Products

From your WordPress admin dashboard, go to WooCommerce > Products.

Step 2: Choose Screen Options

Then you need to select the option Screen Options on the top right of the Products page. Here, you could reduce the number of items per page to 100-200 products per page to speed up the deletion process since more products mean slower loading.

Step 3: Select products to delete

You must now choose the products you wish to remove from your WooCommerce store. You can do this one by one or use filters based on category, stock status, and product type.

Method 2: Running an SQL Command

Step 1: Log in to the phpMyAdmin

Step 2: Select the database

Select the database containing all of the products you wish to delete from the phpMyAdmin screen.

Step 3: Run the SQL statement

Here’s what you should see when you click on the SQL tab

Delete all products in your WooCommerce store by pasting the following code into the MySQL query. Click on the Go button.

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

Keeping your WooCommerce store organized and up-to-date by deleting all products that are no longer sellable is essential.

Related Posts

Creating a Tabbed Settings Page in a WordPress Plugin Using WPPB 10 Essential WordPress Plugins for WordPressers: A Guide to Optimizing Your Website Installing a WordPress Plugin: A Step-by-Step Guide for Newbies How to Create a Custom Contact Form in WordPress How to fix WordPress There has been a critical error on this website The Best Places to Get Royalty-Free Images for Your WordPress Blog Articles  How To Prevent WordPress Blog Content Scraping For Beginners  How To Plan Your WordPress Posts  How To Place Captions On Images In WordPress  WordPress Blog Email Newsletters: What, Why, and How  Are you new to WordPress and curious about managed WordPress hosting?  What You Can Do To Participate In The WordPress Project  What Is A Web Blog, And How Does It Differ From A Website?  What Effect Do Your Web Host’s PHP Updates Have on WordPress Sites?  What Are The Restrictions Of The WordPress. Com Platform?  The Best Places to Get Royalty-Free Images for Your WordPress Blog Articles  Step-by-Step Guide for Installing and Configuring WP Super Cache for New Users  Do you want your WordPress content to have images next to each other?  How to Select the Ideal Color Scheme for Your WordPress Website  How To Pick The Perfect Domain Name  How to Repair the WordPress Error Establishing a Database Connection  How To Fix Typical Image Problems In WordPress  How to Enlarge Images Without Compromising Quality  How to Download and Install Plugins and Themes for WordPress from GitHub  How to Delete Numbers from URLs Created with WordPress  The Step-By-Step Guide To Uploading PDF Files To Your WordPress Website Want to know how to remove digits from WordPress blog posts and URLs?  The Step-by-Step Guide to Linking to an Email Address in WordPress How Does Changing Your WordPress Theme Affect Things?  Getting Started With WordPress Comment Moderation: A Beginner’s Guide  How to Generate Branded Short URLs for Your WordPress Blog: A Step-by-Step Guide WordPress Categories Vs. Tags: How To Sort Your Content For SEO Step-by-Step Guide for New WordPress Users on How to Correctly Uninstall Plugins in WordPress WordPress Theme Framework: What Is It? All That Is Good, All That Is Bad  Images Theft: 4 Approaches to Protect Them in WordPress 7 Crucial Tips for Using WordPress Shortcodes How to Use File Transfer Protocol (FTP) to Upload Files to WordPress for Newbies 5 Easy Ways to Use WordPress to Get More Facebook Likes  How To Setup A WordPress Theme For Beginners How To Get Free WordPress Training In A Week How To Detect and Stop a DDoS Attack Against WordPress How To Install A WordPress Plugin: A Step-By-Step Guide For Newbies How to Delete All of Your Past DNS Records (Chrome, Mac, Windows) How to Create a Site-Specific WordPress Plugin How to Copyright And Trademark Your Blog Name and Logo How To Conduct An Appropriate Website Speed Test (8 Best Tools) To-Do List: 7 Items Before Going Public Your WordPress Site Fixing A Hacked WordPress Website: A Guide For Complete Beginners Tips For Deleting And Removing A WordPress Theme (Step By Step) How to Merge Two WordPress Websites Without Sacrificing Search Engine Optimization Comparing WordPress.Com With WordPress.Org: Which One Is Better? WordPress and GDPR Compliance: The Complete Guide – Everything You Need to Know Which One Is Better: A WordPress Plugin Or A Functions.php File? The Top 10 WordPress Bugs And How To Fix Them How To Making A Website Logo: Step-By-Step Instructions  11 Essential Pages Every WordPress Site Must Have In 2022 WordPress’s 15 Most Frustrating Issues and How to Fix Them WordPress vs. HTML Site- Which Website Design Is Best for Your Business? WordPress Users: 10 Email Marketing Mistakes to Avoid 5 Essential WordPress SEO Audit Checklist Items To Improve Your Rankings 2 Ways to Stop Users from Deactivating WordPress Plugins How to delete all the WooCommerce products with SQL Query? Pagination in WooCommerce: how to set it up? How to Add WooCommerce Product Categories to the Menu What’s the difference between WordPress.com and WordPress.org? How to apply WooCommerce Shortcodes to theme development How to skip the FTP credentials to install the theme and plugin on AWS EC2