I have magento store with 5000 products.

my product url is domain-name.com/xxxxxx.html

where x is a number, how to set the URL to be the same as the product title instead of the number?

3 Answers 3


All Magento products have an attribute called url_key. This attribute is used to compose the URL for a product and filled by default with a filtered version of the product's name (see Mage_Catalog_Model_Product_Url::formatUrlKey()).

Most probably this url_key attribute has been filled with numbers for all your products.

To reset all URL keys, you could empty the URL key for the products and save them again. Magento will fill it with a default URL key, based on the product's name (see Mage_Catalog_Model_Attribute_Backend_Urlkey_Abstract::beforeSave()):

$product = Mage::getModel('catalog/product')->load($productId);

It's Magento's default behaviour that it generates URL from product name.

You should try Truncate url_rewrite table and do reindex catalog url. (Take a table backup first)


Log in to your database and do the following

  1. Do a backup of your database

  2. Then truncate the table core_url_rewrite


    TRUNCATE TABLE core_url_rewrite;


  3. Reindex catalog URL under "System"-->"Index Management"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.