Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Theming Snippets] Remove related products output
@OnlineLogoMaker

This comment has been minimized.

Copy link

@OnlineLogoMaker OnlineLogoMaker commented Mar 24, 2019

It's not working on my store. I add the code with Snippet but the related products still there.
URL sample: https://www.designfreelogoonline.com/logoshop/luxury-alphabet-logo-templates/

Kindly advice what can be done?
I don't want to hide it with CSS, I want to remove it completely.

@friendsfirstphoto

This comment has been minimized.

Copy link

@friendsfirstphoto friendsfirstphoto commented Jun 10, 2019

It's not working for me either and I did exactly as suggested.

@marcos-alexandre82

This comment has been minimized.

Copy link

@marcos-alexandre82 marcos-alexandre82 commented Jun 20, 2019

The code that worked for me was:

add_filter('woocommerce_product_related_posts_query', '__return_empty_array', 100);

@OnlineLogoMaker

This comment has been minimized.

Copy link

@OnlineLogoMaker OnlineLogoMaker commented Nov 19, 2019

Still not working for me, I am using Woocommerce 3.8.0 and Avada 6.1.1... anyone had the same problem?

@marcos-alexandre82

This comment has been minimized.

Copy link

@marcos-alexandre82 marcos-alexandre82 commented Nov 19, 2019

I developed a plugin based on this filter:

https://wordpress.org/plugins/remove-woocommerce-product-related/

If you can test, thank you;)

Thanks!

@surya5353

This comment has been minimized.

Copy link

@surya5353 surya5353 commented Sep 16, 2020

Still not working for me, I am using Woocommerce 3.8.0 and Avada 6.1.1... anyone had the same problem?

function remove_woo_relate_products(){
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
//remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
}
add_action('init', 'remove_woo_relate_products', 10);

@maniac-0s

This comment has been minimized.

Copy link

@maniac-0s maniac-0s commented May 28, 2021

None of these examples works. Why do I need a plugin for every basic thing in wordpress so annoying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment