How to Delete All WooCommerce Products

Remove all WooCommerce products is a good thing, especially when you have got thousands of products and need to make your site clear. We bring solutions that were tested with WordPress version 5.4 and below.

In my case, I needed to change the XML feed setting and all of my current products delete. I had almost 4 000 products already in the shop. Don’t think, that you need to do it manually!

Solution 1: Change a number of items per page

If you don’t have thousands of products, you can click on “Screen Options” on the Products page and set the number of items per page to 100-200 products per page (more products = very slow loading). After that you can manually click on all products checkbox -> Bulk Actions -> Move to Trash

Solution 2: Run an SQL command through PhpMyAdmin

Watch the 1 minute video above. Login to your PhpMyAdmin and choose the correct database. Make sure, that you made backup your database before you execute the SQL statement! Than select table “wp_posts” (if you have wp prefix) and run the SQL statement:

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 execute this SQL statement verify if your products are deleted.

TIP: What about images related to the deleted products? You can use a plugin called Media Cleaner to delete all images that are not already used.

UNLIMITED DOWNLOADS: 50+ Million Website Templates & Design Assets

All the Website Templates you need and many other design elements, are available for a monthly subscription by subscribing to Envato Elements. The subscription costs $16.50 per month and gives you unlimited access to a massive and growing library of over 50 million items that can be downloaded as often as you need (stock photos too)!

Recent Articles

How To Speed Up Your WordPress

Optimizing the speed of your WordPress website is crucial for several reasons. Not only does a fast-loading website provide a better user...

How to Hide “Add to Cart” Button in WooCommerce Quickly

Once on your project, you will maybe need to disable selling products, make a catalog from your e-commerce store, or simply hide...

Agronix – Organic Farm Agriculture WordPress Theme [Free WordPress theme download]

Demo Download Agronix – Organic Farm WordPress Theme. We are Happy to presenting you the Agronix Agriculture Farming WordPress Theme. It is very easy to customize...

Roux – Creative Portfolio WordPress Theme [Free WordPress theme download]

Demo Download This is Roux, a splash of vibrant creativity your beautiful new website needs! Roux comes with tons of creative portfolio, gallery and graphic...

Get in touch

Be our first-class reader, build a community and follow us on social media!

6 Comments

  1. Hi i tried this SQL code and changed the table prefix “gfzc” which got. But i tried this twice and both times it messed up my database.

    DELETE relations.*, taxes.*, terms.*
    FROM gfzc_term_relationships AS relations
    INNER JOIN gfzc_term_taxonomy AS taxes
    ON relations.term_taxonomy_id=taxes.term_taxonomy_id
    INNER JOIN gfzc_terms AS terms
    ON taxes.term_id=terms.term_id
    WHERE object_id IN (SELECT ID FROM gfzc_posts WHERE post_type=’product’);# 421 rows affected.

    Whats wrong?

  2. thanks for this plugin
    can you please guide me. how can i remove 1000 of products of selected date ?? or any date filter for admin ? so that i can filter the products and can remove selected date range products.

Leave A Reply

Please enter your comment!
Please enter your name here