0

The core_url_rewrite is continuously growing infinitely, and my store only got 1000 products, the URL Rewrite Management at backend have "Total 43680 records found", and it is growing, how can i reduce the size of the table, and limit the grow of the table?

0

Try to check your Magento installation for unnecessary stores. Very often people have few 'test' stores alongside the default one. By removing this stores you have a good chance to reduce the core_url_rewrite records count twice or even more.

| improve this answer | |
0

I had searched the internet , the answer is

        /**
         * Check if existing request past can be used
         */
        //if ($product->getUrlKey() == '' && !empty($requestPath)
        if (!empty($requestPath)
            && strpos($existingRequestPath, $requestPath) === 0
        ) {
            $existingRequestPath = preg_replace(
                '/^' . preg_quote($requestPath, '/') . '/', '', $existingRequestPath
            );
            if (preg_match('#^-([0-9]+)$#i', $existingRequestPath)) {
                return $this->_rewrites[$idPath]->getRequestPath();
            }
        }
| improve this answer | |
0

It's safe to truncate the core_url_rewrite table if you don't have custom rewrites in place. This will temporarily fix your speed issue. Immediately after truncating the table, none of your pages will work. Immediately run the reindex for URL rewrites which will go much faster now.
As always, back up the DB before giving this a shot and probably best to put the maint message up by creating maintenance.flag file in your magento root.

Some other tips: - delete unnecessary websites, stores, and store views as these will multiply the number of records respectively. -use .htaccess for custom rewrites. It's faster and prevents problems when clearing core_url_rewrite table - follow the instructions hkinterview for a perm fix, although sometimes it's best to just leave it alone and truncate monthly.

Good luck

| improve this answer | |

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.