As the title asks, how do I remove the "add to compare" button from a "new products" widget? Currently this is what's I'm seeing ... but only within this widget:

enter image description here

I've got the following XML in my theme's default.xml but the compare icon is still visible in the new products widget:

<referenceBlock name="catalog.compare.link" remove="true" />
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="catalogsearch.product.addto.compare" remove="true"/>
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="crosssell.product.addto.compare" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="upsell.product.addto.compare" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="catalog.compare.list" remove="true" />
  • Did you run all command after did that? Please run all commands with di:compile also. Sep 15, 2020 at 4:51
  • Yep ran all commands. It's only this one location where it's appearing. It's the "new products" widget so I was thinking maybe there's something I'm missing. Sep 15, 2020 at 9:30
  • Find the file of new product widget in the theme and remove compare code from it. Sep 15, 2020 at 10:01
  • Surely there's got to be an alternative way to do this than having to override the code. Sep 15, 2020 at 11:33
  • You need to find this in theme. And just remove the code. Sep 15, 2020 at 11:49

1 Answer 1


Open the following list of templates included Luma Magento 2 theme:


For each product list block please change

$showCompare = true;


$showCompare = false;

You can check your phtml file by enabling template path hint .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.