0

I need to delete/truncate the Magento 1.9 core URL rewrites which are older than 3 months of core_url_rewrite table in Database.

What's the exact SQL query to achieve this?

Mesk
  • 187
  • 3
  • 13

2 Answers2

1

URL rewrite tables (both Community and Entrerprise) don't store "created at" or "updated at" values in Magento 1.9.x or 2.x. Without timestamps I wouldn't think it's possible to actually use time as a condition for deletion

0

You could just:

truncate core_url_rewrite;

And then do a reindex on url rewrites.

BUT, I'd follow this question: Magento core_url_rewrite table excessively large and its accepted answer to prevent my table from storing too-oo much data.

Also take a look at this free extension: https://www.magecloud.net/marketplace/extension/dn-d-patch-index-url-1/. It controls the url rewrite reindex process and skips the duplicates.

Pedram Behroozi
  • 817
  • 13
  • 29