Magento URLs With Numbers

Are you seeing some product URLs that look like this – www.mymagentostore.com/mycoolproduct-1435?

Below is a brief explanation of this issue and how to fix it using only the admin panel of Magento. Please note, if you have a large number of products with this issue, you’ll want to look for a coding solution. This is for those who’re experiencing the issue with a relatively small number of products that have likely been uploaded manually.

Why:  Magento (rightly) won’t accept multiple products with identical URLs. This is true regardless of whether or not your simple products are visible individually.

How: This issue may show up for different reasons, but the most common–and most simply addressed– for an administrator is when Simple and Configurable products are created with the same URL key. For example, if you create a three simple products in three different sizes but do not give each one a unique URL key (e.g. productX-small), Magento will add a numeric suffix to each product that is subsequently added with the same root URL. So, in this case your configurable product can end up looking something like /productX-1458.

Remember that magento will auto generate a URL key from the product title. So if you’re simple product title is the same as your configurable product title leaving the URL key field blank will have the same result as entering duplicate URL keys.

What to do? (Again, this is simplest solution without coding or spreadsheets necessary)  To address this issue there are three steps to take:

1) Give each of your products a unique URL key

Simply identify the configurable product and all associated simple products. Starting with the simple products, save each one with a URL that is unique (include reference to size, color, etc). After doing so, make sure that your configurable URL key is correct.

Magento Simple Product URL Key field

 

2) Get rid of URL rewrites

URL rewrite management tabWhen multiple products and variations are created with a single URL key, Magento will create a rewrite to direct links to what it thinks is the correct URL. After you’ve saved your product and it’s variations with unique URLs, you need to delete these rewrites.

To do so, go to Catalog > URL Rewrite Management. Here you should be able to identify all associated rewrites by searching for the base URL key (e.g. productX). Once you’ve identified all associated rewrites, delete them.

Note: this is assuming that the products have URL issues because they are recently added and no significant URL rewrites have been created by the administrator.

3) Reindex Data

The final simple step is to reindex your site so that Magento recognizes the new URLs you’ve created. This is done by going to System > Index Management, Select “Catalog URL Rewrites” (or simply select all, and select the action “Reindex Data.”

reindex data action in magento admin panel

After having completed these steps, you should be able to view www.mymagentostore.com/mycoolproduct without any suffixes being added.

In the near future we’ll try to provide a slightly more complex, but more comprehensive solution for those who are encountering this issue on a larger scale or with a different root cause.

As always, please feel free to add your suggestions!