- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way of bulk deleting products using the sku only?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @bikermanirl,
Maybe you can try to run this into your database:
DELETE FROM catalog_product_entity WHERE sku in (sku1, sku2, sku3, sku4, ...);
Please, rememeber to make a database backup before execute the scrtipt.
Also, after the scritp has finished you should reindex (use the bin/magento indexer:reindex)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
A one time solution. I need to remove a lot of products and manually searching for sku's would take too long.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
@bikermanirl Yes of course through script you can manage this stuff. btw do you already have list of sku's ? Or that also need to figure out ?
Magento Programmer | Was my answer helpful? You can accept it as a solution.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
Thanks, I have the skus
Is there a script I can download to do that?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @bikermanirl,
Maybe you can try to run this into your database:
DELETE FROM catalog_product_entity WHERE sku in (sku1, sku2, sku3, sku4, ...);
Please, rememeber to make a database backup before execute the scrtipt.
Also, after the scritp has finished you should reindex (use the bin/magento indexer:reindex)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
I found this post while looking how to delete products. Are you sure this simple solution works? I know foreign keys will clean up a lot of it. but I also know a Magento golden rule is to use the models and not edit the db directly. Has anyone successfully ( or unsuccessfully) cleaned up products using this method?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Bulk Delete Products by SKU
Doesn't this leave a lot of cruft in tables like catalog_product_entity_int, catalog_product_entity_decimal, etc. Plus all the images still take up space on the server, etc. Seems like, to do a thorough job, there should be a whole list of tables and folders to look through.