How to delete multiple products in Magento?

Delete Multiple Products in Magento

I’ve always been a fan of Magento primarily because of the abundance of features it provides and also the ease of customization to make it suit a business’s precise E-Commerce needs. Like any other platform, Magento also has a few twists and turns where we need to come up with something out of the box to get around them.

Recently, we looked in How to delete duplicate product images in Magento? which is an issue when you import the same product more than once.

Sometimes, you would want to delete multiple products at once but as you already know, Magento backend doesn’t let us do that. If you have a big product catalogue, the process can be very tedious and error prone.

One quick and easy way to do is to run an SQL query via PHPMyAdmin. If you know how to use phpMyAdmin and run queries, go ahead and run the following:

DELETE FROM `catalog_product_entity` WHERE `sku` IN ('SKU1', 'SKU2', ...., 'SKU1000');

If you aren’t familiar with phpMyAdmin, here is how to do it.

1. Login to your CPanel (You should be able to get these details from your hosting service provider)

2. Once logged in, scroll down to the Databases section and click on phpMyAdmin

cpanel-phpmyadmin

3. Select your Magento database in the left panel

How to select phpmyadmin database?

4. Click on SQL on the top bar and copy/paste the query with the values for SKUs corresponding to the SKUs you want to delete from your database

SQL in phpMyAdmin

5. Click GO. Once you do that, a warning will be displayed. Click YES and that’s it. You’re done.

6. Happy times.

Let me know how it goes for you in the comments below. Cheers!

NOTE: Please note that this script is provided as is. I highly recommend you take a backup before running it and doing so will be at your own risk. Thank you.

Online Marketing

Subscribe To My Newsletter

Join my mailing list to receive freebies and the latest in Online Marketing, Entrepreneurship and Electronic Commerce.

Thank you. You are subscribed to awesomeness now!