skip to Main Content

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


  1. You can truncate whole table, Magento will automatically create required ones, just do a reindexing of catalog url rewrites.

    Login or Signup to reply.
  2. You can’t. There is no information about the date in the core_url_rewrite table. You should also watch out for custom redirects, that won’t be recreated automatically. The SQL request to clear out the table, without deleting custom redirects is :

    DELETE FROM core_url_rewrite WHERE is_system = 1;
    

    Once you run a reindex, all the categories and products URLs will be generated again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search