logo woocommerce

How to Remove Related Products on a WooCommerce Product Page

On a single product page, WooCommerce shows related products by default. Here's the code snippet you need to put in your theme's functions.php in order to disable this feature.
Table of Contents

If you purchase through a link on our site, we may earn a commission.

logo woocommerce

On a single product page, WooCommerce shows related products by default. Here’s the code snippet you need to put in your theme’s functions.php in order to disable this feature:

/* Remove WooCommerce Related Products */
add_filter('woocommerce_product_related_posts_query', '__return_empty_array', 100);

If you’re using a theme designed specifically for WooCommerce, you might be able to remove the related posts without any code by using the theme customizer.

Jean Galea is an investor, entrepreneur, and writer. He is the founder of WP Mayor, and the plugins WP RSS Aggregator and Spotlight. He also runs the Good Life Collective. Connect with him on X or visit jeangalea.com.

If you purchase through a link on our site, we may earn a commission.

More from our blog...

3 Responses

Post a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay updated with WP Mayor's newsletter showcase every week

Stay on top of every new WordPress innovation and latest launches. Receive all our fresh product reviews and expert guides directly in your inbox.