Magento URL indexing and core_url_rewrite table

Peter O'Callaghan picture Peter O'Callaghan · Nov 12, 2012 · Viewed 13.4k times · Source

Can anybody shed some light on how Magento determine whether to create a new URL rewrite for a product? Every time I run the Catalog URL Rewrite reindex process the number of rows in core_url_rewrite increases by roughly 10,000 rows. Since no product data has been modified in the mean time, why is a new URL generated?

Answer

SPRBRN picture SPRBRN · Jan 9, 2015

This problem still exists in Magento 1.7, but I have no clue about 1.8 or 1.9. Magento does not delete old entries it seems. This can slow down your database seriously. The easiest way to solve this is to truncate the table and to reindex it.

  • Login to mysql and select (use) the proper database
  • Execute the following query: truncate table core_url_rewrite;
  • Goto the shell folder in your magento root (commandline) and execute the following command: php -f indexer.php -- -reindex catalog_url
  • Alternatively you can do this in the admin: System > Index Management; Reindex Catalog URL Rewrites

Then check in the admin: Catalog > URL Rewrite Management, and see if the new entries have been created. If this shows no items, URL rewrites won't work!