I need to remove the block from layout file using below code,

<referenceBlock name="banner.data" remove="true" />

Because there is no way to disable Magento banners in admin, however, this can be accomplished via layout.

I am not getting in which module and which file I need to add this code. Please suggest path and file achieve this thing.

As shown below enter image description here Thanks

  • Do have sample data OR you installed any extension for banner?
    – Ravi Soni
    Jun 27, 2019 at 11:29
  • no extension, Magento core banners.
    – Charlie
    Jun 27, 2019 at 11:31
  • Actually, we are getting an error on this URL www.example.com/customer/section/load/?sections=cart&update_section_id=false&_=1561625368238. so as I am not using any block on my pages so I want disable these block
    – Charlie
    Jun 27, 2019 at 12:00
  • Is it in the console log?
    – Ravi Soni
    Jun 27, 2019 at 12:30

1 Answer 1


Copy default.xml from vendor/magento/module-theme into your Custom Theme Folder. like this one,


and add this line in defualt.xml

       <referenceBlock name="banner.data" remove="true" />

If not resolved it then please find referenceBlock or referenceContainer name to display it.

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.