Currently my website works well and my products are having the following URLs


However, I bulk changed with the help of a module to a more set friendly URL such as:


The issue is that I changed 17000 products but the redirect did not occur. I need to save the product one by one for my url to work which is crazy. I indexed the page after changing the url but it doesn't work.


2 Answers 2


Please install this module and run below command to regereate URL


 regenerate:product:url [-s|--store="..."] [pids1] ... [pidsN]
 regenerate:category:url [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:category:path [-s]--store="..."] [-r]--root="..."] [cids1] ... [cidsN]
 regenerate:cms-page:url [-s]--store="..."] [pids1] ... [pidsN]

 pids                  Products (or Pages) to regenerate
 cids                  Categories to regenerate

 --store (-s)          Use a specific store (store Id, store code or 'all')
 --root (-r)           Regenerate for root category and its children, ignoring cids. 
 --help (-h)           Display this help message

# Regenerate url for all products and the global store
php bin/magento regenerate:product:url

# Regenerate url for products with id (1, 2, 3, 4) for store 1
php bin/magento regenerate:product:url -s1 1 2 3 4

# Regenerate url for all CMS pages
php bin/magento regenerate:cms-page:url -s all

# Regenerate url for root category 4 and its children for store 1
php bin/magento regenerate:category:url -s1 -r4

Once you run above command. You must need to run reindex command in magento root.

php bin/magento indexer:reindex
php bin/magento cache:clean
  • OK. will try it and let you know how it went. many thanks
    – Henri
    Jun 5, 2023 at 13:58
  • It worked great. Thank you.
    – Henri
    Jun 5, 2023 at 15:18

Please try once this module

link : https://github.com/olegkoval/magento2-regenerate_url_rewrites

Command : php bin/magento ok:urlrewrites:regenerate --entity-type=product

  • That's great! thanks
    – Henri
    Jun 5, 2023 at 15:18

Your Answer

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

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