In Magento 2.* we could extend core layouts using custom theme, for instance, (assuming our custom theme is named Custom/our_theme) if we want to remove header & footer in customer login page we did


<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="footer" remove="true"/>
        <referenceContainer name="header.container" remove="true"/>

However, in Magento 2.3 that way to extend layouts seem to have no effect. The strange thing is we can load CSS changes, override templates, etc... with no problem, so it is clear custom theme is well registered & it is working

But the only way to change layout structure seem to be doing it in a custom module (using layout_load_before event, for instance)

Is this a common issue? I mean, have you faced this in Magento 2.3 here? Or should we assume there is something wrong in our project?


We've seen that applying changes as layout updates then it does work

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <referenceContainer name="footer" remove="true" />
    <referenceContainer name="header.container" remove="true" />

What I don't understand is why the first way (including page & body tags) has stopped working

  • I think you forgot to add <?xml version="1.0"?> see my answer its working fine. Commented Mar 5, 2019 at 5:56
  • That part is present in code, I just didn't paste as it is assumed to be... The only difference I see in your code is the missing of the layout parameter in XML page main tag. I don't know if that could cause the error, but I will try later & give feedback Commented Mar 5, 2019 at 6:57

1 Answer 1


I have tried the below code in my custom theme for Magento2.3 and its working fine :


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <referenceBlock name="header.container" remove="true" />  
      <referenceBlock name="footer" remove="true" />
  • Sorry I didn't read this... Are you sure that's working? Do you use some 3rd party theme? Both header.container & footer are containers, not blocks, so that referenceBlock shouln'd match anything? Commented May 15, 2019 at 9:39

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.