How to Hide Related Products In WooCommerce?

11 minutes read

To hide related products in WooCommerce, you can use a combination of CSS and code snippets within your WordPress theme files. This method involves modifying the style and functionality of the related products section. Here's a step-by-step guide on how to achieve this:

  1. Access your WordPress dashboard and navigate to the Appearance section. Click on "Theme Editor" to open the theme files.
  2. Locate and open the "style.css" file. If you have a custom theme, it might have a different name, such as "custom-style.css" or "theme-style.css".
  3. Scroll to the bottom of the file or the relevant section where you want to add the CSS code.
  4. Add the following CSS code to hide the related products section:
1
2
3
.related.products {
    display: none;
}


This code targets the class responsible for displaying related products and sets its display property to "none", effectively hiding it.

  1. Save the changes made to the "style.css" file.
  2. Next, you need to modify the WooCommerce template file responsible for displaying related products.
  3. In the theme editor, locate the "single-product.php" file. This file is generally found within the "woocommerce" folder or in your theme's root directory.
  4. Open the "single-product.php" file and locate the following line of code:
1
woocommerce_output_related_products();


This is the function call that generates and displays the related products on the product's page.

  1. Comment out or remove this line by adding "//" at the beginning or deleting it altogether:
1
// woocommerce_output_related_products();


By commenting or removing this line, you prevent the related products from being displayed.

  1. Save the changes made to the "single-product.php" file.


After following these steps, the related products section should be hidden on your WooCommerce site.

Best WooCommerce Hosting Providers in November 2024

1
Vultr

Rating is 5 out of 5

Vultr

  • Ultra-fast Intel Core
  • Low Price and High Quality
  • High Performance and Cheap Cloud Dedicated Servers
2
Digital Ocean

Rating is 4.9 out of 5

Digital Ocean

  • Active Digital Community
  • Simple To Use
  • Starting as low as 5$ per month
3
AWS

Rating is 4.8 out of 5

AWS

4
Cloudways

Rating is 4.7 out of 5

Cloudways


Are there any third-party plugins known for hiding related products effectively?

Yes, there are several third-party plugins available that can help you hide related products effectively on e-commerce websites. Some popular ones include:

  1. WooCommerce Hide Related Products: This plugin allows you to easily hide related products on WooCommerce websites. It provides options to hide related products on specific product pages or globally for all products.
  2. YITH WooCommerce Often Bought Together: This plugin allows you to display related products as a bundle or "often bought together" section on your WooCommerce store. However, it also provides options to hide related products if you want to exclude them from being displayed.
  3. Shopify Upsell Product Recommendations: This plugin is specifically designed for Shopify stores and helps you hide related products from the upsell and cross-sell sections. It offers customizable rules and conditions to control which related products should be shown or hidden.
  4. PrestaShop Hide Related Products: If you are running a PrestaShop store, this plugin allows you to hide related products. It gives you the flexibility to set rules based on product attributes, categories, or specific products to control the visibility of related products.


It's important to thoroughly research and read reviews before choosing and installing any third-party plugin to ensure it meets your specific requirements and is compatible with your e-commerce platform.


Can related products be hidden in WooCommerce without any customization?

No, by default WooCommerce does not provide an option to hide related products without any customization. You would need to make some modifications to the code or use a plugin to achieve this functionality. There are various WooCommerce plugins available that can help you hide or customize related products, allowing you to tailor the behavior according to your needs.


What are related products in WooCommerce?

In WooCommerce, related products refer to the feature that allows store owners to display products that are related or similar to the one being viewed by a customer. It is intended to encourage additional purchases and increase the average order value.


Related products can be manually selected by the store owner or automatically suggested based on similarities such as product category, tags, attributes, or purchase history. These related products are displayed on the product page of a specific item, usually in the form of a carousel or a list.


By showing related products, WooCommerce aims to provide customers with more options, increase product visibility, and potentially generate more sales for the online store.

Best WooCommerce Books of 2024

1
Mastering WooCommerce 4: Build complete e-commerce websites with WordPress and WooCommerce from scratch

Rating is 5 out of 5

Mastering WooCommerce 4: Build complete e-commerce websites with WordPress and WooCommerce from scratch

2
WooCommerce Explained: Your Step-by-Step Guide to WooCommerce (The Explained Series)

Rating is 4.9 out of 5

WooCommerce Explained: Your Step-by-Step Guide to WooCommerce (The Explained Series)

3
Build a WordPress WooCommerce From Scratch: Step-by-step: start to sell online

Rating is 4.8 out of 5

Build a WordPress WooCommerce From Scratch: Step-by-step: start to sell online

4
WooCommerce Explained: Your Step-by-Step Guide to WooCommerce

Rating is 4.7 out of 5

WooCommerce Explained: Your Step-by-Step Guide to WooCommerce

5
Build a WordPress WooCommerce From Scratch 2023: Step-by-step: start to sell online

Rating is 4.6 out of 5

Build a WordPress WooCommerce From Scratch 2023: Step-by-step: start to sell online

6
The Web Developer's Guide to WordPress: Learn how to create WooCommerce compatible, customizable and redistributable themes

Rating is 4.5 out of 5

The Web Developer's Guide to WordPress: Learn how to create WooCommerce compatible, customizable and redistributable themes


Is there a plugin or extension available to hide related products?

Yes, there are several plugins and extensions available that can help you hide related products on your website. Some popular options include:

  1. WooCommerce Hide Related Products: This plugin allows you to easily hide related products on WooCommerce-powered websites.
  2. Magento Hide Related Products: If you're using Magento, this extension allows you to hide related products with just a few clicks.
  3. Shopify Hide Related Products: There are various apps available on the Shopify App Store that can help you hide related products on your Shopify store.
  4. Opencart Hide Related Products: Opencart users can use extensions like "Remove Related Products" to hide related products.


These options may vary depending on the platform you are using for your website, so it's best to search for plugins or extensions specifically tailored for your platform.


Are there any alternatives to hiding related products in WooCommerce?

Yes, there are alternatives to hiding related products in WooCommerce. Here are a few options:

  1. WooCommerce Product Tabs: Instead of hiding related products, you can use plugins like "WooCommerce Product Tabs" to add additional tabs to your product pages like "Specifications," "Reviews," or "Related Products." This way, the related products won't be hidden but will be grouped under a separate tab.
  2. WooCommerce Related Products Slider: You can use plugins like "WooCommerce Related Products Slider" to display related products in a slider format on your product pages. This will allow customers to see the related products without cluttering the main product page.
  3. Custom Coding: If you're familiar with coding, you can customize your WooCommerce theme to remove or modify the display of related products. This will require editing the WooCommerce templates and CSS files, allowing you to control how the related products are shown or hidden.
  4. Disable Related Products feature: WooCommerce has a built-in "Related Products" feature that can be disabled from your WooCommerce settings. This will completely remove the display of related products from your product pages.


It's important to note that the options available may depend on the specific theme or plugins you're using with WooCommerce.

Facebook Twitter LinkedIn Whatsapp Pocket

Related Posts:

To export WooCommerce products with images, you will need to follow these steps:Install and activate a WooCommerce product export plugin: There are several plugins available in the WordPress plugin repository for exporting WooCommerce products. Some popular op...
To hide products import and export options in WordPress, you can follow these steps:Log in to your WordPress admin panel.Go to the "Plugins" section and click on "Installed Plugins."Look for a plugin like "WooCommerce" or any other plug...
Hiding prices in WooCommerce can be useful if you want to create a catalog-style website or only want to display prices to specific customers. To achieve this, you can follow these steps:Install and activate a plugin called "WooCommerce Catalog" or som...
To install WooCommerce on HostGator, follow the steps below:Log in to your HostGator cPanel account.Navigate to the "Softaculous Apps Installer" section and click on the "WooCommerce" icon.On the WooCommerce page, click the "Install" bu...
To set up WooCommerce on WordPress, you need to follow a few steps:Install WooCommerce: Login to your WordPress dashboard and go to the "Plugins" section. Click on "Add New" and search for "WooCommerce." Install the plugin and activate ...
To integrate WooCommerce into Shopify, you can follow these steps:Set up your Shopify store: Before integrating WooCommerce, you need to have a functioning Shopify store. Sign up for a Shopify account and complete the basic setup process. Install the Shopify a...