I have a xml file in the vendor directory:


I know that I should never make any change in this directory as it may be overrided by composer. I also know that I should create the the_file.xml in my theme.

my theme path is:


Could you please let me know where the the_file.xml should be created (the exact path) in order to override the vendor xml file ?

2 Answers 2


Try this way...




Please don't forget to clear cache after change in xml files

  • Upvoted question for marking answer as right for question. Commented Sep 6, 2020 at 14:44

Please look at magento 2 documentation



  • So I should always ignore the "view/frontend" ?
    – Anthony
    Commented Sep 4, 2020 at 16:31
  • At first you need to decide: are you gonna extend or override the layout. There are some differences in paths. And a big difference in functionality. But if you build your own theme, in most cases there is enough to extend layouts rather than override them. Yes you need to skip view/frontend after vendor/theme in app folder. You have already set the frontend path in the design folder Commented Sep 4, 2020 at 16:56
  • Unfortunately, it didn't work. I created the following path inside my theme: Module_Name/layout/The_file.xml the file in vendor contains the following: <move element="logo" destination="header-wrapper"/> So in the theme i wrote: <remove element="logo" destination="header-wrapper"/>
    – Anthony
    Commented Sep 4, 2020 at 18:51
  • As per your actions inside the_file.xml I assume that you need to extend the layout. U can use this link as a reference magento.stackexchange.com/questions/92196/… Commented Sep 5, 2020 at 6:38
  • And check please the way you removing the container For example In checkout_cart_index.xml: <?xml version="1.0"?> <page xmlns:xsi="w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header-wrapper" remove="true"/> </body> </page> That’s it. Commented Sep 5, 2020 at 6:48

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.