So generically we can go in developer mode and enable the template links setting as Yes so we can Know which is the Template file for removing the piece of Code
For Removing the Compare Product Block or Recently View Block need to do changes in two files
1.) For Compare Products Block open: app/design/frontend/default/youttheme/layout/catalog.xml
Search for the keyword compare and you will hit 2 lines, comment all of these if you don’t want any instance of compare.
<block type=”core/template” before=”cart_sidebar” name=”catalog.compare.sidebar” template=”catalog/product/compare/sidebar.phtml”/>
<block type=”catalog/product_compare_list” name=”catalog.compare.list” template=”catalog/product/compare/list.phtml”/>
2.) For Recently Viewed Block open: open: app/design/frontend/default/youttheme/layout/reports.xml and comment this line:
<block type=”reports/product_viewed” before=”right.permanent.callout” name=”right.reports.product.viewed” template=”reports/product_viewed.phtml” />
Refresh the cache …Hope this will help you!