Welcome to Sieger Creations Blog.
Many times it happens when you remove want to remove the products from Woocommerce in bulk like 5000 or 10,000 or even more. It consumes too much time and will be full of hectic. With the help of plugins you can remove in bulk but many time they crash the server due to low memory or less execution time of the hosting.
The best way to delete the products in Bulk is by using the MySQL database in the hosting. By going into the phpmyadmin, just run the SQL query and within 2 minutes. Here is the Process:
Step 1: Login to phpmyadmin from your Cpanel Hosting
Login to your cPanel hosting or Plesk hosting, Scroll down to database section and click on phpmyadmin.
Step 2: Select the Database
Click on the Respective database and click on SQL tab at top as shown in the below picture.
Step 3: COPY AND PASTE the below code
DELETE relations.*, taxes.*, terms.*
FROM wp_term_relationships AS relations
INNER JOIN wp_term_taxonomy AS taxes
INNER JOIN wp_terms AS terms
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';
Step 4: Click on Go Button and wait a few minutes.
Once the query is executed properly, All the products are removed. Go and check in WordPress Admin. All the products are removed.
If you like this post, share it with your friends and colleagues and stay tuned for more amazing posts from us.