search

Remove Related Products in WooCommerce

WooCommerce displays related products at the bottom of the product page by default. To remove them, add the following code to your functions.php file. For more on WooCommerce hooks.

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

If you only want to change the number of related products displayed instead of removing them entirely:

add_filter( 'woocommerce_output_related_products_args', function( $args ) {
	$args['posts_per_page'] = 3;
	$args['columns'] = 3;
	return $args;
} );
Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo