cancel
Showing results for 
Search instead for 
Did you mean: 

Bulk Delete Products by SKU

SOLVED
Highlighted

Bulk Delete Products by SKU

Is there a way of bulk deleting products using the sku only?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Bulk Delete Products by SKU

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)

View solution in original post

6 REPLIES 6
Highlighted

Re: Bulk Delete Products by SKU

Hi @bikermanirl,

 

Are you asking for a daily task or a one time solution?

Highlighted

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.

Highlighted

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.
Highlighted

Re: Bulk Delete Products by SKU

Thanks, I have the skus

 

Is there a script I can download to do that?

Highlighted

Re: Bulk Delete Products by SKU

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)

View solution in original post

Highlighted

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?