I'm building a Magento 2.2 store and would like to remove all customer pages like login, account, register, etc.

I noticed that I can remove all customer routes (customer/ * / *) when I remove the /vendor/magento/module-customer/etc/frontend/routes.xml file but of course that's not a neat way, do you guys have an idea on how this could be achieved in a neat way?


  • you can create observer and redirect all this route in specific page like home page so user are not able to access that.
    – Yogesh
    Commented Oct 31, 2017 at 13:06

1 Answer 1


I ended up using the controller_action_predispatch observer and made a list of routes that other users can't access, if the requested route is found in my list, the user gets redirected to the not found page.

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.