Categories
CMS Development Magento

Sql to delete category and its descendants

I am working with a Magento 2 store with very large category tree (over 10000 categories). I used CategoryRepository and delete one by one but this is very time comsuming since delete a brand with 2000 descendants take about 30 minutes.

Is there any sql to delete a category and its decendants and related data from all table? If so is using sql faster than using php code?

Leave a Reply

Your email address will not be published. Required fields are marked *