Disable Related Products in WooCommerce Product Pages

Posted on by Dan Pock
Reading Time: 2 minutes

There are many reasons to not include related products on your store. Regardless of those reasons, there’s a couple options for you if you’re looking to remove, or stop, the related products from showing on your store.

How do I stop related products from showing in the store?

Option 1: Using your theme

If you are using a pre-built theme, chances are that they have an option for to control this section. It's likely something you may find under the single product page options. If you're theme has this customization option built in then you can remove the related products without using any code.

So be sure to check your theme settings or options to see if this is something you can just enable or disable there! If you're unsure where to look check for your themes options page, if it provides one, or the WordPress theme cutomizer.

Option 2: Using some code

If you are using a custom built theme, or a theme that doesn’t have an option to remove the related products from the single product page - you're not out of luck. You can add the following code snippet to your theme’s functions.php file. Take note, we provide two methods to accomplish this task - you should try the top method first and attempt the alternative method if that one does not work.

WordPress Code Warning: This article features code changes, or snippets, that you can make in your active themes function.php file. If you are unfamiliar with this task, or want to brush up, we have an article on Managing code snippets in WooCommerce. The technique provided can be used for both WordPress and WooCommerce sites.


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

functions.php (Alternative)

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

This single line of code should be enough to disable the related products from showing up. In fact, this line actually simply removes the related products 'action' from being run on the page all together. If for some reason this does not work for you and the theme you're using you can try the second (alternative) method provided!

Give us a call at 800.580.4985, or open a chat or ticket with us to speak with one of our knowledgeable Solutions or Experienced Hosting advisors to learn how you can take advantage of these techniques today!

Avatar for Dan Pock

About the Author: Dan Pock

Dan Pock does technical support at Liquid Web with a background in System Administration, Public Relations, and Customer Service. His favorite things include his cats, Oscar Boots, and Dash Nougat; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

Latest Articles

How to Install Zen Cart on CentOS 7

Read Article

How to Make OpenStack Work for You

Read Article

Five Steps to Create a Robots.txt File for Your Website

Read Article

Premium Business Email Pricing FAQ

Read Article

Microsoft Exchange Server Security Update

Read Article