Remove Related Products

Remove Related Products on WooCommerce

Remove Related Products | Do you want to hide related products from the WooCommerce Single Product Page? In some cases, you may want to hide the related products from your single product page. So let’s see how can we do that by adding a single line of code.

STEP 01 : First thing you need to do is to find the functions.php file from your theme folder. It’s better to add new code on the child theme’s functions.php file so that if you update the theme in the future your changes will not be lost.

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

STEP 02 : To remove related products in this step we need to add the above code to our functions.php file. Update the file and check your WooCommerce single product page.

NOTE : Make sure to take a backup of your functions.php file before editing it. After editing the functions.php file if you see any error on your website you can use the backup code to fix the error.

N.B. This is a developer-level tutorial. If you feel, it’s difficult to do for you. You may consider hiring me through Fiverr. I’ll fix your issue as soon as possible.

Table of Contents :

Leave a Comment

Your email address will not be published.