I am using Magento for my eCommerce website

My current URL structure is:


I want a solution for the URL to be changed to :


I just want to remove subcategory from the URL

1 Answer 1


You can configure it by URL Rewrites

  1. Go to Magento 2 Admin -> Marketing -> SEO & Search -> URL Rewrites

  2. Find the path by searching Request path column.

  3. Change The Path same like example given below and save that.

  4. Remove the cache php bin/magento cache:clean.

  5. Refresh the front-end, click the main menu category then you can see the configured path.

Example Like :

Request path parent-category/sub-category/page.html

Modified path parent-category/page.htm

  • What To do when there are more then 500 categories there? Commented Mar 30, 2022 at 11:38

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.