Removing products and categories from the database

Last modified by jrutter on Fri, June 25, 2010 09:52
Source|Old Revisions  

This is an old revision of the document!

Removing products through the database

Be careful it's for a very old version of Magento

This should remove all the products and their related records.

  1. TRUNCATE TABLE `catalog_product_entity`;

Removing categories requires bit more actions.

  1. TRUNCATE TABLE `catalog_category_entity`;
  2. DELETE FROM `catalog_category_tree` WHERE `entity_id`<>1;

After that you will have to create root categories for your stores and assign them to stores in configuration:

admin menu / system / configuration / catalog - choose a store, choose Root Category.

Just tested this in v1.1.6 and it worked successfully, just please make sure that you make a backup of your database before executing this sql.