Hi
Magento 2.3.0
I have 39500 products on my website
I want to delete 8950 products, but it is very slowly
please help me to fast do it
thanks
Solved! Go to Solution.
Hello @houman_ahghari ,
You can use database to quickly remove these product. Use the following query:
DELETE FROM catalog_product_entity WHERE sku in (sku1, sku2, sku3, sku4, ...);
After executing the above query please execute the following command (via terminal) from your magento root folder:
php bin/magento indexer:reindex
Note: Please take the backup of DB before executing first command.
If this helps you please accept it as solution and give kudos.
Regards.
@houman_ahghari If there is a particular login of which product needs to be deleted then you can create a file on root with logic of deleting products according to particular condition.
Or you can use the below sql query.
DELETE FROM catalog_product_entity WHERE entity_id in (select entity_id from catalog_product_entity where condition);
Get all the ids which you want to delete using select statement and then delete all using this query.
Make sure to take database backup.
Thanks
Hello @houman_ahghari ,
You can use database to quickly remove these product. Use the following query:
DELETE FROM catalog_product_entity WHERE sku in (sku1, sku2, sku3, sku4, ...);
After executing the above query please execute the following command (via terminal) from your magento root folder:
php bin/magento indexer:reindex
Note: Please take the backup of DB before executing first command.
If this helps you please accept it as solution and give kudos.
Regards.
@houman_ahghari If there is a particular login of which product needs to be deleted then you can create a file on root with logic of deleting products according to particular condition.
Or you can use the below sql query.
DELETE FROM catalog_product_entity WHERE entity_id in (select entity_id from catalog_product_entity where condition);
Get all the ids which you want to delete using select statement and then delete all using this query.
Make sure to take database backup.
Thanks