Remove Related Products in WooCommerce latest version

To remove related products on a WooCommerce product page, Use the following code:

Add the following code at the end of your functions.php file located in wp-content/themes/your-theme-name/

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

That’s it

Leave a comment

Your email address will not be published. Required fields are marked *


Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /var/www/hellojewel.net/htdocs/wp-includes/functions.php on line 4552

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /var/www/hellojewel.net/htdocs/wp-includes/functions.php on line 4552