I need to remove .html from category Url.



Required url:


I am removing from admin. But it's not working.

Does anyone have a solution for this?


  • where you have change setting
    – Amit Bera
    Apr 17, 2019 at 8:13
  • 2
    Did you try to spend some time on internet to search about it !!
    – anonymous
    Apr 17, 2019 at 8:13
  • Go to Stores > Configuration > Catalog > Catalog > Search Engine Optimization > Category URL Suffix to remove .html you can change configuration and save it. Apr 17, 2019 at 8:13
  • 2
    Possible duplicate of Magento 2: Product URL Suffix Apr 17, 2019 at 9:12
  • When I try to remove the Catalog URL Suffix I am getting following error: Unique constraint violation found
    – Shomita
    Apr 17, 2019 at 9:22

1 Answer 1


Open admin panel and go to :-

Stores >> Configuration >> Catalog >> Search Engine Optimization

Here Two option

Product URL Suffix = .html 

Category URL Suffix= .html

Please leave as Blank

Please see screenshots :- https://prnt.sc/nd2owm

If you get this type of error :-

Unique constraint violation found

Please Follow this steps one by one.

1). Backup your current Magento2 database

2). Delete all records from table url_rewrite. You can run the following SQL command: DELETE FROM url_rewrite WHERE entity_type = 'product';

3).Login to your Magento 2 backend >> Re-save all your Categories and then run this command :- php bin/magento cache:flush

4).Then you will be able to save the Product URL Suffix in the Configuration Settings.

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.