Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    Remove blocks or containers from layout magento2

    Today i am explaining how to remove a block or container called by layout files.

    Firstly you need to create layout file for the same controller.
    for example : catalog_category_view.xml

    Now add the line in your layout file:

    in this, you can use referenceBlock for the blocks, and referenceContainer for the containers.
    name, is the name of the block or container which you want to remove.
    remove, is set to true to remove.

    your file will be like this:

    After flushing cache, the whole content container will get removed from category page.

    Hope, this will helps you adding functionality in your module.

    Thank you.

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again