How to remove related products and upsells in WooCommerce

Looking to remove related products and upsells in your WooCommerce store? All you may need is to remove two actions using your WordPress theme’s functions.php file.

Through your functions file

Remove related products

For removing related products in WooCommerce, you simply need to remove the woocommerce_output_related_products action from the woocommerce_after_single_product_summary hook, as per the example below.

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

A breakdown of the code above:

  1. woocommerce_after_single_product_summary is the WooCommerce hook (found in content-single-product.php).
  2. woocommerce_output_related_products is the hooked action.
  3. 20 is the location/order of which this action is hooked by.

Remove upsells

To remove product upsells in WooCommerce, you need to remove the woocommerce_upsell_display action from the woocommerce_after_single_product_summary hook, as per the below example.

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );

A breakdown of the code above:

  1. woocommerce_after_single_product_summary is the WooCommerce hook (found in content-single-product.php).
  2. woocommerce_upsell_display is the hooked action.
  3. 15 is the location/order of which this action is hooked by.