fervor [>]CODING & CURIOSITY
FERVOR LEARNING SYSTEMTUTORIALS
← WordPress

WordPress / 3 MIN READ

Deleting all Products in WooCommerce

Deleting all Products in WooCommerce

From the original Fervor library. Examples may use older package versions.

🧹 Tutorial: How to Delete All WooCommerce Products (Safely & Quickly)

⚠️ WARNING BEFORE YOU START:

Backup your site and database first. Once the products are gone, they’re gone — no “undo” button.


🛠️ METHOD 1: Use the Built-In Bulk Editor (for Small Stores)

Best for: Less than 100-200 products

Steps:

  1. Log in to WordPress Admin Dashboard.
  2. Go to Products > All Products.
  3. Click the checkbox at the top to select all products on the page.
  4. In the Bulk Actions dropdown, choose Move to Trash → Click Apply.
  5. If you have more than one page, repeat for each page.
  6. Once all are trashed, go to Trash, then click Empty Trash.

🪦 Poof! Products gone.


⚡ METHOD 2: Use a Plugin (Fast & No Code)

Best for: Lots of products, safer than touching the database

Plugin: “WP All Import – WooCommerce Add-On” or “Bulk Delete”

Steps (with “Bulk Delete” plugin):

  1. Go to Plugins > Add New.
  2. Search for Bulk Delete, install and activate it.
  3. Go to Bulk WP > Bulk Delete Posts.
  4. Choose Products from the post type list.
  5. Set any filters (or skip them to delete everything).
  6. Check “Delete Permanently”, then hit Bulk Delete.

🧨 In seconds, everything’s wiped out.


🧠 METHOD 3: Delete via Database (for Devs and Local Environments)

Best for: Super fast cleanup (e.g., dev reset) — Use with caution

Steps:

  1. Open your local dev environment (phpMyAdmin, Adminer, or command line).
  2. Run these SQL queries:
DELETE FROM wp_posts WHERE post_type = 'product';
DELETE FROM wp_posts WHERE post_type = 'product_variation';
DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT ID FROM wp_posts);

Optional cleanup (just to tidy things up):

DELETE FROM wp_term_relationships WHERE object_id NOT IN (SELECT ID FROM wp_posts);

⚠️ Replace wp_ with your actual table prefix if it’s different.


🧹 Bonus Tip: Reset WooCommerce Completely

If you’re testing or starting fresh:

  1. Install WP Reset plugin.
  2. It lets you reset your entire WP site, or just specific tables like WooCommerce products/orders.

BONUS BONUS CLEAN


🧙‍♂️ Pro Tips & Power Moves for Deleting WooCommerce Products


🔥 Pro Tip #1: Delete Product Images Too (Save Disk Space)

Deleting products doesn’t always delete the images (they stay in the Media Library like ghosts of products past).

Solution:

Use this SQL after deleting products (⚠️ CAREFUL):

DELETE FROM wp_posts 
WHERE post_type = 'attachment' 
AND post_parent = 0 
AND post_mime_type LIKE 'image/%';

Or use a plugin like Media Cleaner to find and delete unused media safely.


💨 Pro Tip #2: Use WP-CLI for Lightning Fast Deletes

If you’re using MAMP/XAMPP with terminal access, WP-CLI is 🔥

wp post delete $(wp post list --post_type='product' --format=ids) --force

This command deletes all products instantly, without using the admin panel.

Bonus: Add --yes at the end to skip confirmation.


🧼 Pro Tip #3: Delete Product Meta and Orphans for a Clean DB

Deleting products leaves behind junk metadata and taxonomy relationships. Use a plugin like Advanced Database Cleaner or run this:

DELETE pm 
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL;

Result: Leaner, faster database.


🚀 Pro Tip #4: Automate with Scheduled Tasks

If you’re in a dev/staging workflow, use plugins like WP Crontrol or set up a cron job to auto-delete all products nightly or weekly.

wp_schedule_event( time(), 'daily', 'delete_all_products' );

Super useful for demo sites or rotating product setups.


🧠 Pro Tip #5: Export Before Deleting (Just in Case)

Even if you plan to destroy everything, do a quick export using:

  • WooCommerce > Products > Export
  • Or WP All Export

You’ll thank yourself when you realize you deleted the wrong category. 😅

Keep your curiosity going.Explore more WordPress →
287 TUTORIALS · 22 TOPICSREADY