General

How to Remove Blocks or Containers From Layout Magento 2

Hello Magento Folks?,

Welcome To MageComp Blog. Today I will help you to Remove blocks or containers from layout Magento 2. Look at the most recently published blog about How to Upgrade Magento 2 with composer. So without further ado Let’s Dive In?.

Introduction

Mainly, Magento 2 provides many attractive options for attracting customers to your store. In appreciation to Magento we can say that it never fails in providing the updates as per the latest trends. It continuously tries to improve the customer experience. And in this continuous cycle, many times there is a requirement of removing a block from the layout in Magento 2. Look at the given below solution where it is illustrated with the help of codes.

Steps to Remove Blocks or Containers From Layout Magento 2

Step 1: Firstly, create layout file catalog_category_view.xml and add the following code in that layout file.

<referenceBlock name="block_name" remove="true"/>

Your Code will look like this.

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<body>

<referenceBlock name="content" remove="true" />

</body>

</page>

Flush the cache and refresh the page you will be easily able to remove the container from the blog.

Final Words:

I hope after going through the above illustration you are able to remove containers from the layout of Magento 2. In case any difficulties do contact our Support Team form more guidance. If you like the solution then do share with your Magento buddies and don’t forget to comment down your reviews regarding the above article. 

Happy Reading & Catch you on the next Magento Tutorial! 

Click to rate this post!
[Total: 2 Average: 5]
Gaurav Jain

Gaurav Jain is Co-Founder and Adobe Certified Expert-Magento Commerce Business Practitioner. Being Computer Engineer👨‍💻 and possessing Extensive Marketing skills he handles all kinds of customer Queries and his Happy😀 & Helping🙏 Nature makes customer's day Delightful. When he isn’t working, you’ll find Gaurav Reading on Books📖 or Traveling🚗. Also, he is Speaker at Magento Meetups.

Recent Posts

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

2 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

4 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

4 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

5 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

6 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

1 week ago