I would like to remove the comparison feature from catalog pages. I enabled developer hints for the template and found that the file containing the comparison icons was located at:


I then went ahead and created a file in my theme directory as follows:


However there is no difference on the frontend. Assuming I've got the folder structure wrong, but I double checked and it looked ok?

2 Answers 2


You are in wrong phtml, you could found the declaration in vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml

<block class="Magento\Catalog\Block\Product\View" name="product.info.addto" as="addto" template="product/view/addto.phtml"/>

You need to override that phtml in your custom theme. just copy addto.phtml in app/design/frontend/vendor/theme/Magento_Catalog/templates/product/view/addto.phtml after that remove or comment compare link.

Remove or comment below line

<a href="#" data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product);?>'
        class="action tocompare"><span><?php /* @escapeNotVerified */ echo __('Add to Compare') ?></span></a>

remove var/cache var/page_cache as well as browser cache before tested otherwise old cache files only get display. it perfectly work I have tested

screenshot for your easy reference


If you want remove compare feature in catalog page :

Go to our custom theme:


add below line:

   <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"/>


Remove var/*

<magento-root> $ rm -rf var/* 

remove  var/cache, var/page-cache, va/generation,var/log,..

check it. i hope this is useful for you.

  • Thanks - what do you mean Remove var/* ? Commented Sep 19, 2016 at 15:48
  • @JoeAinsworth I update my answer Commented Sep 19, 2016 at 16:00
  • I've tried this but to no success. The template hint is showing the file at /var/www/public/vendor/magento/module-catalog/view/frontend/templates/product/list/addto/compare.phtml. As per your suggestion I created a file in /var/www/public/app/design/frontend/Whistlefish/theme/Magento_Catalog/layout/catalog_category_view.xml. I then used rm -rf var/* but the compare feature was still present. Commented Sep 19, 2016 at 18:14

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.