How we are remove all products URL rewrites in Enterprise Web Application in magento2 - magento source24
In this blog post im share code with you to How we are remove all products URL rewrites in Enterprise Web Application in magento2 -
In my case im delete all rewrites products URL in enterprise web application in magento2, so here I'm running Enterprise 1.13
👉 In Enterprise I'm notice that there a number of different tables that control rewrites URL .
there are 6 table are contain all the rewrites URL :
- enterprise_url_rewrite
- enterprise_url_rewrite_category_cl
- enterprise_url_rewrite_product_cl
- enterprise_url_rewrite_redirect
- enterprise_url_rewrite_redirect_cl
- enterprise_url_rewrite_redirect_rewrite
to delete all product rewrites URL in magento2 to truncate all of them.
to truncate all the table you will run this bellow SQL Query :
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `core_url_rewrite`;
TRUNCATE TABLE `enterprise_catalog_category_rewrite`;
TRUNCATE TABLE `enterprise_catalog_product_rewrite`;
TRUNCATE TABLE `enterprise_url_rewrite`;
TRUNCATE TABLE `enterprise_url_rewrite_category_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_product_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_rewrite`;
SET FOREIGN_KEY_CHECKS = 1;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_rewrite`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_redirect`;
TRUNCATE TABLE `enterprise_url_rewrite_product_cl`;
TRUNCATE TABLE `enterprise_url_rewrite_category_cl`;
TRUNCATE TABLE `enterprise_url_rewrite`;
TRUNCATE TABLE `enterprise_catalog_product_rewrite`;
TRUNCATE TABLE `enterprise_catalog_category_rewrite`;
TRUNCATE TABLE `core_url_rewrite`;
when SQL Query run successfully and rebuilt all rewrite tables :
After then run command in your project root :
- php shell/indexer.php --reindex catalog_url_product
- php shell/indexer.php --reindex catalog_url_category
- php shell/indexer.php --reindex url_redirect