In this post I am going to explain how to remove containers or blocks from layout in Magento 2.
First you need to add one layout file in your extension or theme. In this, you need to use referenceBlock for the blocks, and referenceContainer for the containers.
To remove the Container:
1 | <referenceContainer name="footer-container" remove="true"/> |
To remove the Block:
1 | <referenceBlock name="top.search" remove="true"/> |
In this, “name” is the name of the block or container which you want to remove.
After done with the changes, flush the cache and check for the result.
Thats it. Enjoy Magento 2!!
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!
Leave a Reply