Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active December 29, 2023 16:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogists/283ebce1fa16a98113c40bbbc10a96ae to your computer and use it in GitHub Desktop.
Save woogists/283ebce1fa16a98113c40bbbc10a96ae to your computer and use it in GitHub Desktop.
[Theming Snippets] Remove related products output
@friendsfirstphoto
Copy link

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

@marcos-alexandre82
Copy link

The code that worked for me was:

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

@OnlineLogoMaker
Copy link

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

@marcos-alexandre82
Copy link

I developed a plugin based on this filter:

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

If you can test, thank you;)

Thanks!

@surya5353
Copy link

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
Copy link

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

@midweste
Copy link

midweste commented Oct 4, 2021

For those that had probems with this working, you need to wait until woocommerce is loaded before you can remove this action as this action has yet to be added until a point later in the process

add_action('woocommerce_loaded', function () { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); }, PHP_INT_MAX);

@AHmii079
Copy link

I developed a plugin based on this filter:

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

If you can test, thank you;)

Thanks!

does work dude!!

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