How to remove/disable add to compare in Magento 2?

How to remove/disable add to compare in Magento 2?

In today’s tutorial, we will see how we can remove/disable add to compare functionality from all places in Magento 2.

There is no configuration setting to remove the “Product Compare” feature in Magento2.

But we can use the remove=”true” attribute in our theme’s custom layout file and remove/disable add to compare related reference blocks.

we can use the default.xml file to remove these links from all the pages in our theme.

for example,


Also, you may need to make $showCompare variable value to “false” in all below .phtml files by overriding it in your custom theme.

You may also like :

How to Remove Blocks or Containers From Layout in Magento 2?

How to remove blocks programmatically in Magento 2?

That’s it for this tutorial, See you in the next blog. Thank You 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *