I need to delete the compare button from product list but I don't know how to to do it in Magento 2.1.6.
Under [vendor]/[theme]/Magento_Catalog/templates/product/
I deleted the following in list.phtml:
<?php
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
?>
<a href="#" class="action tocompare" title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product); ?>'
role="button">
<?php /* @escapeNotVerified */ echo __('<i class="fa fa-refresh"> </i>') ?>
</a>
and deleted the following in listing.phtml
. '<a href="' . $block->getAddToCompareUrl($_product) . '" class="action tocompare">'
. '<span>' . __('Add to Compare') . '</span></a>
It didn't work.