Remove Upsell From the Single Product Page

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

Using this PHP snippet requires OceanWP 3.4.2 version or above.

To remove Up-Sell products display item from the WooCommarce single product page, add the following PHP snippet:

function owp_upsell_woo() {
    remove_action( 'woocommerce_after_single_product_summary', array( OceanWP_WooCommerce_Config::instance(), 'upsell_display' ), 15 );
}
add_action( 'wp', 'owp_upsell_woo' );

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.