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?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityURL 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
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.