3

I am wanting to add redirects from old site URL to new site URLs however when I go into URL Rewrite Management there are over 8,000 records there already. Can I delete these?

Most of them are in the following format: ID Path: product/1483 Request Path: brilliant-whisper-300-1483.html Target Path: catalog/product/view/id/1483

I'm hesitant about deleting them if they are necessary...

4

The answer is - as always - it depends :)

In general, you can truncate (not delete!) the table core_url_rewrite. If it is empty, your SEO URLs like brilliant-whisper-300-1483.html will not work for the time being. But if you do a full reindex of the catalog URL rewrites, these URLs will be generated again, so that your SEO URLs should work again.
If you struggle with a very big core_url_rewrite table, then have a look at this Magento StackExchange question.

What can cause problems is if you did one of the following:

  1. You changed the URL key of a catalog/product and ticked the box Create Permanent Redirect for old URL. Assumed you changed the URL key from my-old-product-name to my-new-product-name. Then, when this box is ticked, a rewrite from my-old-product-name.html to my-new-product-name.html will be created in the core_url_rewrite table. If you truncate the table, this rewrite will be gone, so that your old product URL will not work any more.
  2. You created custom URL rewrites under Catalog - URL Rewrite Management. These custom URL rewrites will also be gone if you truncate core_url_rewrite.
  • Thank you for giving a more objective answer. If you're worried about 301 redirects for pages whose URL keys have been changed after Google has indexed the pages and they've been linked to elsewhere, you get a little less cavalier about just blindly truncating this table. Only in 1.7 and 1.8 where there's a category save bug, do you get concerned about "excessive" numbers of entries. SUPEE-389_EE_1.12.0.2_v1.patch – Fiasco Labs Sep 5 '14 at 2:47
1

for me with 1.9.2 this does a temporary fix. Simons link is more permanent..check it out. So instead of truncating all of the data, especially if your custom urls are THE most important function of the core rewrites, you can query the database to omit custom url rewites and to show only the system url rewites. Then you can delete your system url rewrites. However, this will cause problems IF you still NEED your old urls, you will lose your old URL's this way. Some people do not need the old url's. Its a quick dirty way to clean that rewrite table. as always export backups FIRST.

0

Truncate core_rewrite table after doing a backup of that table. That should do the job.

  • And after you do that, have him tell you how to get the ones you need back... They're there for a reason and SEO friendly URLs require them. You may be fixing a conceived problem by creating a real problem. – Fiasco Labs Sep 4 '14 at 2:46
  • @FiascoLabs you can regenerate the required rows executing "reindex". – lrkwz May 22 '15 at 8:00
  • Not the ones you hand entered... – Fiasco Labs May 22 '15 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.