I want to remove compare product and wish list block from left panel.

I don't want to change template. I am using 2columns-left.

in magento 1.x, We uses like following in layout file.

   <reference name="left">
      <remove name="left.newsletter"/>

What to do to remove block from magento 2.x?

6 Answers 6


Its almost the very same way

<referenceBlock name="block.name.wantoberemoved" remove="true"/>

Remove compare products from sidebar

<referenceBlock name="catalog.compare.sidebar" remove="true" />

Remove Wishlist from sidebar

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

In Magento 2, you can remove Compare products and Wishlist from sidebar blocks of Category Page through xml. You can remove it by adding a default.xml file to your theme in: theme_dir/Magento_Catalog/layout/default.xml

And add below XML

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="catalog.compare.sidebar" remove="true"/>
    <referenceBlock name="sidebar.additional" remove="true"/>

You can create new deafult.xml in your custom module and write below code to remove recent order block from Left sidebar

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     <referenceContainer name="sidebar.additional">
         <referenceBlock name="catalog.compare.sidebar" remove="true"/>
         <referenceBlock name="wishlist_sidebar" remove="true"/>

The code works fine in Magento 2.1.1.

With little changes :

instead referenceBlock replace with referenceContainer

<referenceContainer name="block.name.wantoberemoved" remove="true"/>

What worked for me, even via admin "Layout XML Update" field, was the code

<referenceContainer name="sidebar.additional" remove="true" />

A quick note for Enterprise users: you may need to remove the "multiple wishlist" block as well:

<referenceBlock name="multiple-wishlist_sidebar" remove="true" />
  • Man, I could not get wishlist sidebar to go away on an EE site. This worked perfect. Thank you!
    – Corgalore
    Commented Jun 27, 2018 at 15:58

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.