How do I delete a range of duplicate products from categories using a MySQL query? For example, Category 1 has 1000 products that are already in their rightful place.
Thank you.
MySQL: Delete Range of Products from Category
-
- Lead Developer
- Posts: 2439
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 51 times
- Been thanked: 138 times
Re: MySQL: Delete Range of Products from Category
I would do that via the admin page categories.php to ensure that you only delete those products that need deleting. Alternatively if you have a list of product_id you could delete directly from the relevant tables in phpmyadmin (untested [so make a backup] and obviously change X, Y, Z to the list of product_id you have);
delete from products where products_id in (X, Y, Z);
delete from products_description where products_id in (X, Y, Z);
same for other tables such as products_to_categories, reviews etc etc
delete from products where products_id in (X, Y, Z);
delete from products_description where products_id in (X, Y, Z);
same for other tables such as products_to_categories, reviews etc etc
Gamechanger Addon: Queued Emails, try before you buy.