Comments 45Clara started the conversationMarch 2, 2022 at 3:49pmHi,I'm trying to remove upsell or related products to move them, with the following code, but it doesn't work: remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); remove_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products', 10 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 1 ); remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); remove_action( 'woocommerce_after_single_product', 'woocommerce_output_related_products', 10 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 1 );I also tried with: remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); But it didn't work better. 1,877Judith repliedMarch 2, 2022 at 4:28pmHi Mjouan,Thanks for keeping in touch.Please check this out:https://wpza.net/how-to-remove-related-products-and-upsells-in-woocommerce/.Thanks. 45Clara repliedMarch 3, 2022 at 7:50amHi,I think you didn't read my message. What you propose is exactly what I did. That's the problem...Regards,Clara 1,877Judith repliedMarch 3, 2022 at 7:58amHi Mjouan,Please send in your website url so that we can remove them using a possible css.Thanks. 45Clara repliedMarch 3, 2022 at 9:22amI know how to hide them using CSS, I'm a web developer, I want to know how to remove them using PHP. Having hidden related products is not good for performance. 1,877Judith repliedMarch 3, 2022 at 9:33amHi Mjouan,Is it possible you can send us your admin login credentials so that we can try out from your end please.Thanks. Clara replied privately 1,877Judith repliedMarch 3, 2022 at 12:16pmHi Mjouan,Please allow me to escalate this to the developer to check it out.Thanks. 45Clara repliedMarch 3, 2022 at 1:51pmSure, no problem.1 Like 1,070ThemeNectar repliedMarch 3, 2022 at 5:53pmHey Mjouan, The following snippet will remove both related and upsell products: add_action('init','salient_child_mod_woo_related'); function salient_child_mod_woo_related() { remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 21 ); }Kind regards, 45Clara repliedMarch 4, 2022 at 8:22amThanks a lot, it works perfectly!! I didn't know I had to wrap it with a function to make it work.Great support as always :)1 Like Sign in to reply ...
Hi,
I'm trying to remove upsell or related products to move them, with the following code, but it doesn't work:
I also tried with:
But it didn't work better.
Hi Mjouan,
Thanks for keeping in touch.
Please check this out:https://wpza.net/how-to-remove-related-products-and-upsells-in-woocommerce/.
Thanks.
Hi,
I think you didn't read my message. What you propose is exactly what I did. That's the problem...
Regards,
Clara
Hi Mjouan,
Please send in your website url so that we can remove them using a possible css.
Thanks.
I know how to hide them using CSS, I'm a web developer, I want to know how to remove them using PHP. Having hidden related products is not good for performance.
Hi Mjouan,
Is it possible you can send us your admin login credentials so that we can try out from your end please.
Thanks.
Hi Mjouan,
Please allow me to escalate this to the developer to check it out.
Thanks.
Sure, no problem.
Hey Mjouan,
The following snippet will remove both related and upsell products:
Kind regards,
Thanks a lot, it works perfectly!! I didn't know I had to wrap it with a function to make it work.
Great support as always :)