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?

2 Answers 2

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.

1
  • Thanks. But I need to delete the URL rewrites older than 3 months. Is it possible?
    – Mesk
    Aug 1, 2018 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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