WooCommerce

How to Hide Related Products in WooCommerce (4 Ways)

Open any WooCommerce product page and scroll past the description, and you will usually find a section titled Related products or You may also like. WooCommerce adds this section automatically by pulling products from the same categories or tags, and for many stores it is a welcome discovery tool. But it is not right for every store. If you sell a single flagship product, run a membership site, or want a distraction free path to the checkout, those extra product cards can work against you. The good news is that hiding them is easy, and you have several ways to do it depending on your comfort with code. This guide walks you through four methods, from a two line CSS fix to a proper code snippet, plus how to hide the section on selected products only.

What Are Related Products in WooCommerce?

Related products are a product grid that WooCommerce prints near the bottom of every single product page. By default, WooCommerce fills this grid with products that share the same product categories or tags as the item being viewed. If a visitor is looking at a pair of running shoes, the related section shows other shoes from the same category. The section is generated by the woocommerce_output_related_products function, which is hooked into the woocommerce_after_single_product_summary action. Most themes display it automatically, and many themes rename the heading to something like You may also like or Customers also bought. One important distinction: related products are not the same as upsells or cross sells. Upsells are products you choose manually in the Linked Products tab, and cross sells appear on the cart page. We will cover how to hide those separately below.

Why Would You Hide Related Products?

Store owners hide the related products section for practical business reasons, not just looks. Here are the most common ones:

  • Cleaner product pages. If you sell one flagship product or a small catalog, a grid of near identical items can confuse buyers instead of helping them decide.
  • A stronger upsell strategy. You may want visitors to see only your hand picked upsells, not an automatic grid that competes with them for attention.
  • Digital and membership products. A course, ebook, or membership plan rarely benefits from related product cards, which look out of place next to a simple buy button.
  • A distraction free buying path. Every extra link on a product page is an exit ramp. Fewer exits can mean more completed orders, especially on mobile.
  • Full brand control. Custom built landing style product pages often look better without any of WooCommerce’s default sections.

If any of these match your store, read on. The method you choose depends on whether you want a quick visual fix or a clean removal that stops the section from loading at all.

How Do I Hide Related Products with CSS? (Method 1)

CSS is the fastest way to hide related products. It needs no plugins and no PHP. Go to Appearance, then Customize, then Additional CSS in your WordPress dashboard and paste this rule:

.related.products {
    display: none;
}

Click Publish and refresh any product page. The related products section will disappear from view. Here is the catch: CSS only hides the section visually. The products are still loaded in the page HTML, so you gain no performance benefit, and a curious visitor could still find them in the page source. For a quick cosmetic fix that is perfectly fine, but if you want the section gone properly, use the code method below. Also note that some themes use a different CSS class for this section. If the rule above does nothing on your theme, inspect the section with your browser developer tools and replace .related.products with your theme’s class. If your catalog also lists items you cannot sell right now, learn how to hide out of stock products in WooCommerce for an even cleaner shop.

How Do I Remove Related Products with a Code Snippet? (Method 2)

This is the cleanest method because it stops WooCommerce from generating the related products section in the first place. You need just one line of PHP:

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

Never paste this directly into your theme’s functions.php file, because the next theme update will wipe it out. Use the free Code Snippets plugin instead. Install it, add a new snippet, paste the line above, set it to run everywhere, and activate it. The section disappears from every product page and nothing related loads in the background. If you manage several small tweaks this way, also read our guide on creating a WordPress child theme so you understand where custom code belongs. For the technically curious, the remove_action() documentation explains exactly how this unhooks WooCommerce’s default output.

How Do I Hide Upsells and Cross Sells Too?

As mentioned earlier, related products, upsells, and cross sells are three different things, and they are controlled by three different functions. To hide upsells from the product page, add this line to the same snippet:

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );

To hide cross sells from the cart page, add this line as well:

remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );

Combine all three lines in a single snippet and every automatic product suggestion is stripped from your store. You can also keep them as three separate snippets so you can toggle each one independently while testing.

How Do I Hide Related Products on Selected Products Only? (Method 3)

Maybe you want related products on most items but not on your flagship product or your digital downloads. This snippet hides the section only for products in a category you choose:

add_action( 'woocommerce_after_single_product_summary', 'vut_conditional_related_products', 1 );
function vut_conditional_related_products() {
    if ( has_term( 'digital-downloads', 'product_cat' ) ) {
        remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    }
}

Replace digital-downloads with your own category slug, which you can find under Products, then Categories in your dashboard. This approach is perfect for stores that mix physical and digital products, since digital products rarely need a related items grid. If you sell configurable items, check our guide on WooCommerce product variations to see how related products interact with variation pages.

Is There a One Click Option in My Theme or a Plugin? (Method 4)

Before writing any code, check whether your theme already has a switch for this. Many popular themes include a product page setting in the Customizer or in the theme options panel with a checkbox labeled something like Show related products. Unchecking it is the simplest solution of all, and it is fully update safe. If your theme has no such option and you prefer not to touch code, install a dedicated plugin instead. Search the plugin directory for a related products disabler, install it, and the section is gone with zero configuration. This is the best route for non coders, although the one line snippet in Method 2 does exactly the same thing with less overhead on your site.

When Should You Keep Related Products Visible?

Hiding related products is not always the right call. They earn their place when:

  • You run a large catalog where discovery matters, such as clothing, electronics, or books.
  • Your average order value grows when shoppers add one more item to the cart.
  • You rely on internal linking to help search engines crawl and understand your product pages.

Remember that related products create internal links between your product pages, which helps both visitors and search engines discover more of your catalog. If your goal is higher order values rather than minimalism, keeping related products visible and pairing them with smart discounts can work better than hiding them. Our guide on creating coupon codes in WooCommerce shows how to set up promotions that turn those extra product views into extra sales.

How Do I Verify the Change and Restore the Section Later?

After applying any method, open a product page in a private or incognito browser window so you see what real visitors see rather than the logged in admin view. If you use a caching plugin, clear the cache first, or you may think the change failed when only the old cached page is showing. To bring related products back, simply reverse what you did: delete the CSS rule, deactivate the snippet, recheck the theme option, or deactivate the plugin. Nothing here is permanent, which makes it safe to experiment. If product pages still feel slow after your cleanup, the bottleneck is often the server itself, so read our web hosting guide to learn what to look for in a WooCommerce friendly host.

Frequently Asked Questions

Will hiding related products hurt my SEO?

Not in any meaningful way. Hiding the section removes some internal links between product pages, which can slightly reduce crawl discovery on very large stores, but it will not cause penalties or ranking drops. Your product pages, categories, and sitemap still give search engines everything they need. If internal linking is a priority for you, keep the section visible instead.

Should I use CSS or the code snippet method?

Use CSS when you want a quick, reversible visual change and you are not comfortable with PHP. Use the remove_action snippet when you want the section gone properly, because it stops WooCommerce from generating the HTML at all. For a permanent decision, the snippet is the better choice.

How do I bring related products back after hiding them?

Just reverse the method you used. Remove the CSS rule from Additional CSS, deactivate the Code Snippets entry, tick the theme option back on, or deactivate the disabler plugin. Then clear your cache and check a product page in an incognito window to confirm the section is back.

What is the difference between related products and upsells?

Related products are generated automatically from shared categories and tags. Upsells are products you recommend manually for each item in the Linked Products tab of the product editor. Cross sells are similar manual recommendations that appear on the cart page. Each one is controlled separately, so hiding related products does not affect your upsells or cross sells.

Last updated: October 2026.

Hostinger - Get 20% OFF

Habib ur Rehman

Hello! I'm the founder of VU Tech Geek. As a BSCS graduate and experienced WordPress professional, I'm passionate about technology and education. My Virtual University journey has given me valuable insights and knowledge, which I love to share with fellow students.… More »

Related Articles

Leave a Reply

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

Back to top button

Adblock Detected

Please consider supporting us by disabling your ad blocker