VPS business hosting starting at $29.95/24/7 premium technical support

Remove Compare feature from Magento 2

How to remove “Add to Compare” links in sidebar and product page in Magento 2 product pages

Magento 2 Community has a default feature of comparison lists for multiple products. Learn how you can disable the “Add to Compare” feature in magento2 community edition.

Add the following lines in default.xml of your theme folder

	<referenceBlock name="catalog.compare.sidebar" remove="true"/>
	<referenceBlock name="catalog.compare.link" remove="true"/>
	<referenceBlock name="related.product.addto.compare" remove="true"/>
	<referenceBlock name="view.addto.compare" remove="true"/>
	<referenceBlock name="upsell.product.addto.compare" remove="true"/>

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

Leave a Reply

Your email address will not be published.