How to disable simple product URL rewrite management by Magento?

How to disable simple product URL rewrite management by Magento?

August 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to disable simple product URL rewrite management by Magento?

Optimizing Magento URL Rewrite Management for Multiple Stores

The Challenge: Heavy URL Rewrite Table Slowing Down Performance

As an e-commerce manager running three online stores on a single Magento installation, you’re facing a common performance issue - an overburdened URL rewrite table. With 10,000+ SKUs of simple products, the mage::dispatch::routers_match function is taking over 5 seconds to complete due to the sheer volume of entries.

This slowdown negatively impacts your site’s speed and user experience. But what if you could tell Magento to stop rewriting URLs for certain product types? Let’s explore how to optimize this situation without compromising SEO or functionality.

Understanding URL Rewrite Management in Magento

Magento uses URL rewrite management to create clean, search engine-friendly URLs for each product. By default, it generates a URL rewrite record for every product type - simple, configurable, virtual, and grouped products.

However, in your case, you’re only displaying Grouped Products on the frontend while the majority of SKUs are Simple Products hidden from view. This leads to an unnecessary proliferation of URL rewrites that clutters your database and slows down performance.

Specifying Which URLs Magento Should Rewrite

To address this issue, we’ll look at how to instruct Magento to stop rewriting URLs for simple products specifically. Here’s a step-by-step approach:

Step 1: Identify the Relevant Core File

The function responsible for refreshing product URL rewrites is located in app/code/core/Mage/Catalog/Model/Url.php. We need to modify this file to exclude Simple Products from the rewrite process.

Step 2: Modify the refreshProductRewrites Function

Open the refreshProductRewrites function and locate the following code block:

foreach ($products as $product) {
    // ... (existing code)
}

Step 3: Implement a Conditional Check for Simple Products

Add an if-else statement to check if the product is of type “simple.” If it is, use continue to skip the URL rewrite process. Here’s the modified code block:

foreach ($products as $product) {
    if($product->getTypeId() == "simple"){
        continue;
    }
    else {
        // ... (existing code)
    }
}

Step 4: Test and Monitor Performance

After applying this change, Magento will no longer generate URL rewrites for Simple Products. This should significantly reduce the size of your URL rewrite table.

Revisit Varien Profiler to monitor the performance improvement in mage::dispatch::routers_match. You can expect a substantial reduction in execution time as Magento processes fewer URLs.

Conclusion: A Practical Solution for E-commerce Managers

By following this approach, you’ve successfully optimized your Magento installation for multiple stores with minimal impact on SEO. Remember that proper URL management is crucial for better site performance and improved user experience.

If you’re looking to further enhance your e-commerce setup, consider exploring Laravel’s ecommerce development services or Magento 2 extension development.

These resources provide expert guidance on optimizing Magento for complex environments and offer custom solutions tailored to your business needs.

Catalog Database Performance Security

Our network