Is there a way of bulk deleting products using the sku only?
Solved! Go to Solution.
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)
A one time solution. I need to remove a lot of products and manually searching for sku's would take too long.
@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 ?
Thanks, I have the skus
Is there a script I can download to do that?
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)
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?
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.