Page 1 of 1
MySQL: Delete Range of Products from Category
Posted: Tue Jul 27, 2021 8:37 am
by lecarlb
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.
Re: MySQL: Delete Range of Products from Category
Posted: Tue Jul 27, 2021 3:08 pm
by burt
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