There are four different methods for removing related products from WooCommerce: a single PHP hook in your functions.php file, using a free plugin, hiding them with CSS, or targeting specific products one at a time.
We checked each method in October 2026 against the WooCommerce 11.1 source code and the WooCommerce docs. How you remove the section matters more than most tutorials say.
Most tutorials will just give you a code snippet and not explain the difference between hiding an element and removing it. This is significant because it affects the speed of the load time on your page.
In this tutorial, you will learn four ways to remove related products from WooCommerce and when to use each one. You will also see how to change the related products count and what to show in their place.
What Makes WooCommerce Show Related Products (And When To Stop Showing Them)
WooCommerce shows related products under each product by matching shared categories and tags. You cannot pick them by hand. Removing them makes sense when your catalog is small, the matches look wrong or the page already ends with a strong call to action.
How WooCommerce Determines What is “Related”
WooCommerce builds related products from items that share a tag or category with the product being viewed. It shows them below the product with no setup from you. The WooCommerce linked products guide confirms you cannot choose them by hand.
There are also two other product recommendation types worth knowing. Upsells are products you manually link to a product, shown on the product page. Cross-sells are products you manually link, shown on the cart page. Both are controlled by you. Related products are not.
This automatic behavior is exactly why it causes problems. The algorithm doesn’t know your store the way you do.
Situations Where It Makes Sense to Remove Them
In a few basic scenarios, it makes sense to remove related products from WooCommerce product pages.
You can have a small catalog for your store. If you sell ten products and WooCommerce recommends the same three items on each page, it looks messy and provides little value. A store that offers limited-edition products or customized services is likely to get into such an issue early on.
Your catalog might also produce poor matches. Think of a store that sells quality photography gear. WooCommerce keeps showing cheap accessories because they share a category, and that undercuts your position.
Some product pages already work well without it. A page with strong copy, good photos and a clear call to action does not need extra noise at the bottom.
Method 1: Use CSS to Hide Related Products (Quickest Option)
This is the easiest method, but before you use it, read the instructions below.
- Log in to your WordPress dashboard.
- Go to Appearance > Customize.

- Select Additional CSS from the left sidebar.

- Add this code:
.related.products {
display: none;
}
- Click Publish.

That’s it. The related products section disappears from your product pages.
Important: This technique only hides the section from view. WooCommerce still builds it on every product page load. It caches the list of related IDs for a day, but it still loads each product and prints its HTML.
For a low-traffic store with a small catalog, this is unlikely to cause a noticeable difference. On a larger store with real traffic, the extra work adds up. The hidden HTML also stays in your page source.
Method 2 below removes the section for real if you are fine with a little code. Check out our WooCommerce SEO Guide to see how page speed affects your store’s rankings.
Method 2: Using a PHP Hook To Disable Related Product Display (Most Preferred Method)
This is the most efficient approach. It prevents the related products’ function from running at all by using WooCommerce’s built-in hook function. No query is executed. There is no HTML generated. The section simply doesn’t exist. This works on classic themes, as the WooCommerce template functions source shows. Block themes use the Site Editor method further down.
The hook that you require is:
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
There are two distinct approaches available for you to insert this code.
Inserting Code into Your Child Theme’s functions.php
This is easy as long as you can find your way around within the theme files.
- Log in to your WordPress dashboard and go to Appearance > Theme File Editor (Tools > Theme File Editor on block themes).
- Make sure to choose the child theme rather than the parent theme. Code added to the parent theme’s functions.php is wiped out when the parent theme updates.
- Once you are on the correct Child Theme, go to the right side under Files and find the functions.php file.
- At the bottom of the functions.php, paste your code:
/** * Remove related products on all single product pages */ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
- Click Update File.

Visit any product page and confirm the related products section is gone.
Don’t have a child theme? If you’re running a parent theme directly, don’t edit its functions.php. Move to the Code Snippets method below.
Use the Code Snippets Plugin (No Editing of Theme Files)
For the majority of store owners, this is the safer option. You may add PHP functions directly from your WordPress dashboard using the free Code Snippets plugin. There is no chance that the next theme update will break your website because no theme files were altered.
- Look for Code Snippets under Plugins > Add Plugin.
- Install and activate it.

- Open the Snippets menu and add a new PHP snippet.
- Give it a name you’ll remember later such as “Remove WooCommerce Related Products.”
- In the code box, paste your hook:
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
- Set the scope so the snippet runs on the front end of your site.
- Save the snippet and make sure it is switched to active.

Done. The related products section is gone from every product page. Theme updates won’t touch your change.
Method 3: Use a Plugin (No-Code Option)
If you don’t want to touch any code, the NS Remove Related Products for WooCommerce plugin does it with a single checkbox. It is free and had 3,000+ active installs as of October 2026.
- In your WordPress dashboard, go to Plugins > Add Plugin.
- Look for NS Remove Related Products.
- Click Install Now and then Activate.

- Navigate to Remove Related and select the Enable Plugin checkbox and click Save Changes.

That’s all it takes. Related products disappear from every product page on your store.
For more tools like this, browse our WooCommerce extensions.
Method 4: Remove Related Products from Specific Products Only
This method fits when most products should keep related products and a few should not.
Maybe you want related products to show on most of your catalog, but there are specific products where the section doesn’t make sense. A primary product with a long, detailed page. A bundle where cross-shopping would hurt the deal. A product in a category that simply has no good related items.
You can target individual products using a custom conditional inside the hook. Here’s how.
Per-Product Removal Using a Conditional Check
This solution first determines whether the current product page matches a certain product ID. It then conditionally removes the related products output for that product only.
- Find the product ID of the product you want to target. Go to Products > All Products, hover over the product, and take note of the ID number displayed in the URL (e.g.,
?post=347). - Add the following code to your child theme’s functions.php or use the Code Snippets plugin:
/**
* Remove related products on specific products only
*/
add_action( 'woocommerce_before_single_product', 'conditionally_remove_related_products' );
function conditionally_remove_related_products() {
$excluded_product_ids = array( 347, 512, 891 ); // Replace with your product IDs
if ( is_product() && in_array( get_the_ID(), $excluded_product_ids, true ) ) {
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
}
}
- Replace
347, 512, 891with the exact product IDs from which you wish to delete related products. - Save and test by visiting the product pages.

Related products keep showing on every product you did not list. The listed products lose the section and its query.
Remove Related Products from One Category
The same pattern works for a whole product category. Swap the ID check for has_term() with your category slug. Every product in that category loses the related products section.
/**
* Remove related products for one product category
*/
add_action( 'woocommerce_before_single_product', 'dd_remove_related_in_category' );
function dd_remove_related_in_category() {
if ( is_product() && has_term( 'your-category-slug', 'product_cat', get_the_ID() ) ) {
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
}
}
Replace your-category-slug with the slug shown under Products > Categories.
When This Makes More Sense Than Sitewide Removal
When you have a variety of products in your store, use per-product removal. Some products really benefit from the related products section. Others do not. When similar products are consistently irrelevant over your whole catalog, sitewide removal is the best option.
How to Remove Related Products in a Block Theme
Block themes like Twenty Twenty-Five do not use the PHP hook for related products. The Single Product template adds them as a block pattern instead. Remove that block in the Site Editor and the section disappears from every product page that uses the template.
- Go to Appearance > Editor > Templates and open Single Product.
- Open the List View and select the Related Products block near the bottom.

- Delete the block and click Save.
We confirmed in the WooCommerce 11.1 template files that the default Single Product template loads related products this way. A custom template from your theme may place them differently.
Which Method Should You Use?
Most stores should use the PHP hook through the Code Snippets plugin. It stops the related products query and survives theme updates without a child theme. CSS is the quickest fix but only hides the section, and block themes need the Site Editor.
| Method | Skill level | Stops the query | Survives theme updates |
|---|---|---|---|
| CSS (Method 1) | Beginner | No | Yes |
| PHP hook in functions.php (Method 2) | Intermediate | Yes | Only with a child theme |
| Code Snippets plugin (Method 2 alt) | Beginner to intermediate | Yes | Yes |
| NS Remove Related Products plugin (Method 3) | Beginner | Not stated | Yes |
| Per-product PHP conditional (Method 4) | Developer | Yes | With a child theme or Code Snippets |
| Site Editor in a block theme | Beginner | Yes | Yes |
The plugin row says “Not stated” because its listing does not say whether it stops the query or only hides the output.
How to Change Related Products in WooCommerce
You can keep related products and change how many show or how WooCommerce picks them. The woocommerce_output_related_products_args filter sets the count and columns. Two more filters decide whether WooCommerce matches by category, by tag or by both.
By default WooCommerce shows four related products in four columns in random order. This snippet changes that to three of each.
/**
* Show 3 related products in 3 columns
*/
add_filter( 'woocommerce_output_related_products_args', 'dd_related_products_args' );
function dd_related_products_args( $args ) {
$args['posts_per_page'] = 3;
$args['columns'] = 3;
return $args;
}

To match related products by category only, turn off tag matching with this one line. Use woocommerce_product_related_posts_relate_by_category the same way to match by tag only.
add_filter( 'woocommerce_product_related_posts_relate_by_tag', '__return_false' );
WooCommerce caches each product’s related list for a day. Clear transients under WooCommerce > Status > Tools if the new matching does not show right away. Block themes set the count in the Related Products block settings instead.
What to Include Instead: Upsells and Manual Cross-Sells
Removing the related products section does not require you to leave that space empty. In most circumstances, it is better to replace WooCommerce’s automated suggestions with manual ones that you can control.
WooCommerce provides you with two options for this: upsells and cross-sells. Upsells are displayed on the product page, in the same location where similar products previously appeared. Cross-sells are displayed on the cart page. Both are set for each product under the product editor’s Linked Products tab, as the WooCommerce docs explain.
You know your catalog and your customers better than a tag match does. A store selling running shoes can link a specific insole and sock bundle to one shoe model. WooCommerce’s matching only sees tag overlap and guesses.
To set manual upsells, open the product and go to Product data > Linked Products. Search for the products you want in the Upsells field and click Update. They appear just above where related products used to sit.
For a more in-depth look at how product page design and recommendation placement impact conversions, visit our guide on designing WooCommerce product pages.
Need more control over how product recommendations are shown? Our custom WooCommerce development services can help.
Conclusion
To remove related products from WooCommerce, the PHP hook is the best option in most cases. Add it through Code Snippets or a child theme’s functions.php. It stops the query and survives theme updates when done right.
If you’re a beginner, the NS Remove Related Products plugin gets the job done without code. To remove related products from only some products or one category, use the conditionals in Method 4. Block themes need the Site Editor.
Whatever method you choose, consider what you’re putting in the space instead. Manual upsells in WooCommerce take five minutes to configure and give you full control over what customers see after they’re done reading your product page. That’s almost always a better outcome than leaving it to an algorithm.
If your store needs related products reworked in a custom way, our development team can build it for you.
Frequently Asked Questions (FAQs)
Q1. Does removing related products affect my WooCommerce SEO?
There is no negative SEO effect when using the PHP hook approach. It simply prevents a section of the content from loading. Using CSS to hide the part while the PHP query is still running has an impact on SEO since it causes unnecessary server processing time to be added to each product page load. Use PHP hooks or plugins instead of CSS if you want lean, clear product pages.
Q2. What makes related products, upsells and cross-sells different in WooCommerce?
WooCommerce uses shared categories and tags to automatically create similar products. They cannot be chosen manually. Products that you actively link to a particular product are known as upsells, and they appear on the single product page. Products that you manually link to show up on the cart page are known as cross-sells. Although you have complete control over upsells and cross-sells, you have no control over similar products.
Q3. Will removing related products break anything on my WooCommerce store?
No. An independent output hook is a part found in related products. Removing it has no impact on your cart, checkout, product data, pricing, or any other WooCommerce feature. It just disables the query and display of that content block.
Q4. Can I remove related products without a plugin or code?
Several WooCommerce-compatible themes’ customizer options have the ability to toggle on or off related products. Check the Appearance > Customize or in its dedicated settings panel. Customize it or use the specific options panel. It is the simplest option if it is available. But not all themes include it.
Q5. Why are my related products showing irrelevant items?
WooCommerce uses common categories and tags to match products. The related items section will frequently display poor results if your catalog has broad categories or if several product kinds share the same tags. Tightening up your tagging structure can assist, but a cleaner long-term solution is to remove the area and replace it with manual upsells if the recommendations are regularly ineffective.
Q6. Can I delete related products from one category rather than the entire store?
Yes, with a minor PHP update. Instead of searching for a product ID, you look for a category term. Use has_term( ‘your-category-slug‘, ‘product_cat‘ ) inside the conditional function in Method 4 to replace the product ID check. This eliminates the similar items section from all products in the category.
