Title: Can&#8217;t remove compare button
Last modified: August 30, 2023

---

# Can’t remove compare button

 *  [shahadul878](https://wordpress.org/support/users/shahadul878/)
 * (@shahadul878)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/cant-remove-compare-button/)
 * Hello,
 * I was trying to remove compare button from product loop default position. Use
   remove_action hook but its not working.
 *  I was trying both way from my theme and plugin.
 *     ```wp-block-code
       remove_action('woocommerce_after_shop_loop_item', ['YITH_Woocompare_Frontend', 'add_compare_link'],20 );
   
   
   
       global $yith_woocompare;
       remove_action( 'woocommerce_after_shop_loop_item', [ $yith_woocompare->obj, 'add_compare_link' ], 20 );
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Alessio Torrisi](https://wordpress.org/support/users/alessio91/)
 * (@alessio91)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/cant-remove-compare-button/#post-17013142)
 * Hi there,
 * unfortunately this feature is not available in this version of the plugin, I 
   can’t provide support for it.
 * For any question get in touch with us at [https://yithemes.com](https://yithemes.com).
 * Thanks for your time.
 *  Thread Starter [shahadul878](https://wordpress.org/support/users/shahadul878/)
 * (@shahadul878)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/cant-remove-compare-button/#post-17023610)
 * We are using your plugin in our premium theme. Our product loop and design are
   different from the default. For this reason, we need to change your button position.
   How can we remove your default position? If it’s not possible to change button
   position, we need to remove your plugin’s support from all of our themes.
 *  [crodriguez1991](https://wordpress.org/support/users/crodriguez1991/)
 * (@crodriguez1991)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/cant-remove-compare-button/#post-17027092)
 * Hello there,
 * I hope you’re doing well 😀
 * In order to remove the compare button, you can try to add the following code 
   in the functions.php of your active theme:
 *     ```wp-block-code
       if( !function_exists('yith_disable_compare') ){
           add_action('template_redirect','yith_disable_compare');
   
           function yith_disable_compare(){
               global $yith_woocompare;
                   remove_action( 'woocommerce_after_shop_loop_item', array( $yith_woocompare->obj, 'add_compare_link' ), 20 );
           }
       }
       ```
   
 * Please, try it and let me know.
 * Have a good day.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Can’t remove compare button’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-compare/assets/icon.svg?rev=3042935)
 * [YITH WooCommerce Compare](https://wordpress.org/plugins/yith-woocommerce-compare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-compare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-compare/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-compare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-compare/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [crodriguez1991](https://wordpress.org/support/users/crodriguez1991/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/cant-remove-compare-button/#post-17027092)
 * Status: not resolved