How to remove block from left or right panel in magento 2?
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"> <body> <referenceBlock name="catalog.compare.sidebar" remove="true"/> <referenceBlock name="sidebar.additional" remove="true"/> </body> </page>
The code works fine in Magento 2.1.1.
With little changes :
instead referenceBlock
replace with referenceContainer
<referenceContainer name="block.name.wantoberemoved" remove="true"/>