{"id":114790,"date":"2018-03-07T15:01:19","date_gmt":"2018-03-07T15:01:19","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=114790"},"modified":"2025-12-31T10:44:42","modified_gmt":"2025-12-31T10:44:42","slug":"remove-blocks-containers-layout-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/","title":{"rendered":"Remove Blocks or Containers from Magento 2 Layout"},"content":{"rendered":"\n<p>Today, we will explain how to remove blocks or containers called by layout files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Are Blocks &amp; Containers in Magento 2?<\/h2>\n\n\n\n<p>Magento 2 uses a <strong>layout XML system<\/strong> to build the structure of every page. This structure is mainly composed of <strong>blocks<\/strong> and <strong>containers<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Containers<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Containers define the <strong>page structure<\/strong><\/li>\n\n\n\n<li>They control <strong>where content appears<\/strong><\/li>\n\n\n\n<li>They do <strong>not render HTML themselves<\/strong><\/li>\n\n\n\n<li>Examples:\n<ul class=\"wp-block-list\">\n<li><code>header.container<\/code><\/li>\n\n\n\n<li><code>content<\/code><\/li>\n\n\n\n<li><code>footer<\/code><\/li>\n\n\n\n<li><code>sidebar.main<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Containers act like <strong>holders or wrappers<\/strong> for blocks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Blocks<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Blocks are responsible for <strong>rendering actual content<\/strong><\/li>\n\n\n\n<li>They output <strong>HTML to the frontend<\/strong><\/li>\n\n\n\n<li>Usually linked to <code>.phtml<\/code> templates or UI components<\/li>\n\n\n\n<li>Examples:\n<ul class=\"wp-block-list\">\n<li>Product list<\/li>\n\n\n\n<li>Mini cart<\/li>\n\n\n\n<li>Newsletter subscription<\/li>\n\n\n\n<li>CMS static blocks<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p> Blocks live <strong>inside containers<\/strong> and display data to users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Remove Blocks or Containers?<\/strong><\/h3>\n\n\n\n<p>Firstly, you need to create a layout file for the same controller.<br>for example: catalog_category_view.xml<\/p>\n\n\n\n<p>Now add the line in your layout file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;referenceBlock name=&quot;your block name&quot; remove=&quot;true&quot; \/&gt;<\/pre>\n\n\n\n<p>In this case, you can use referenceBlock for the blocks and referenceContainer for the containers.<\/p>\n\n\n\n<p>&#8220;name&#8221; is the name of the block or container that you want to remove.<br>&#8220;remove&#8221; is set to true to remove.<\/p>\n\n\n\n<p>Your file will be like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; layout=&quot;2columns-left&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n\t&lt;body&gt;\n\t\t&lt;referenceBlock name=&quot;content&quot; remove=&quot;true&quot; \/&gt;\n\t&lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p>After flushing the cache, the whole content container will be removed from the category page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Removing Blocks or Containers Safely \u2014 Best Practices<\/h3>\n\n\n\n<p>Use a checklist:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Do not edit core Magento<\/li>\n\n\n\n<li>Use a custom theme or module<\/li>\n\n\n\n<li>Test with caching ON<\/li>\n\n\n\n<li>Avoid removing JS-critical containers<\/li>\n<\/ul>\n\n\n\n<p>Hope this will help you add functionality to your module.<\/p>\n\n\n\n<p>I hope this blog will help you Remove Blocks or Containers from the Layout of Magento 2. You may also check our wide range of best&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 Extensions<\/a>.<\/p>\n\n\n\n<p>Please reach out to our team via a&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">support ticket<\/a>&nbsp;if you have any queries.<\/p>\n\n\n\n<p>Try this, and if you have any queries, then just comment below \ud83d\ude42<\/p>\n\n\n\n<p><br>For technical assistance, please get in touch with us via email at\u00a0<a href=\"mailto:support@webkul.com\" target=\"_blank\" rel=\"noreferrer noopener\">support@webkul.com<\/a>.<\/p>\n\n\n\n<p>Discover powerful solutions to enhance your Magento 2 store by exploring our&nbsp;<a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 plugins<\/a>&nbsp;page.<\/p>\n\n\n\n<p>Bring your vision to life with custom-built solutions\u2014hire skilled&nbsp;<a href=\"https:\/\/webkul.com\/hire-magento-developers\/\">Magento 2 developers<\/a>&nbsp;today.<br>Happy Coding!!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we will explain how to remove blocks or containers called by layout files. What Are Blocks &amp; Containers in Magento 2? Magento 2 uses a layout XML system to build the structure of every page. This structure is mainly composed of blocks and containers. Containers Containers act like holders or wrappers for blocks. Blocks <a href=\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302],"tags":[256,2070,6274],"class_list":["post-114790","post","type-post","status-publish","format-standard","hentry","category-magento2","tag-layout","tag-magento2","tag-remove-block-from-page"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Remove Blocks or Containers from Layout Magento 2 Step by Step<\/title>\n<meta name=\"description\" content=\"We&#039;ll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Remove Blocks or Containers from Layout Magento 2 Step by Step\" \/>\n<meta property=\"og:description\" content=\"We&#039;ll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-07T15:01:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-31T10:44:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Bulbul\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bulbul\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\"},\"author\":{\"name\":\"Bulbul\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e\"},\"headline\":\"Remove Blocks or Containers from Magento 2 Layout\",\"datePublished\":\"2018-03-07T15:01:19+00:00\",\"dateModified\":\"2025-12-31T10:44:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\"},\"wordCount\":347,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"layout\",\"Magento2\",\"remove block from page\"],\"articleSection\":[\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\",\"name\":\"Remove Blocks or Containers from Layout Magento 2 Step by Step\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2018-03-07T15:01:19+00:00\",\"dateModified\":\"2025-12-31T10:44:42+00:00\",\"description\":\"We'll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Remove Blocks or Containers from Magento 2 Layout\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e\",\"name\":\"Bulbul\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Bulbul\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/bulbul896\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Remove Blocks or Containers from Layout Magento 2 Step by Step","description":"We'll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/","og_locale":"en_US","og_type":"article","og_title":"Remove Blocks or Containers from Layout Magento 2 Step by Step","og_description":"We'll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.","og_url":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-03-07T15:01:19+00:00","article_modified_time":"2025-12-31T10:44:42+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Bulbul","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Bulbul","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/"},"author":{"name":"Bulbul","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e"},"headline":"Remove Blocks or Containers from Magento 2 Layout","datePublished":"2018-03-07T15:01:19+00:00","dateModified":"2025-12-31T10:44:42+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/"},"wordCount":347,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["layout","Magento2","remove block from page"],"articleSection":["Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/","url":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/","name":"Remove Blocks or Containers from Layout Magento 2 Step by Step","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2018-03-07T15:01:19+00:00","dateModified":"2025-12-31T10:44:42+00:00","description":"We'll discuss how to remove unnecessary blocks and containers in Magento 2 using layout XML, move instructions, and best practices.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/remove-blocks-containers-layout-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Remove Blocks or Containers from Magento 2 Layout"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/c9c6288b3950490ffdb37cb2a526996e","name":"Bulbul","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/37ea7175f5ae6557d01bb38e147f6a02a540714ecdb71770d8ec554d4d34c23f?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Bulbul"},"url":"https:\/\/webkul.com\/blog\/author\/bulbul896\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/114790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=114790"}],"version-history":[{"count":11,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/114790\/revisions"}],"predecessor-version":[{"id":519643,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/114790\/revisions\/519643"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=114790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=114790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=114790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}