How to remove related products from WooCommerce
In this tutorial, we are going to look into the different ways you can remove the related product functionality from WooCommerce.
Removing related products in WooCommerce involves adjusting settings or using code to remove the related products section from your WooCommerce single product. This customization allows for a more focused shopping experience for customers.
WooCommerce, by default, shows the related products widget on the single product page. Recommending a related product can be a beneficial part of your cross-selling strategy. This is the most basic form of cross-selling, and most online stores almost universally use it. But also, there are many situations when recommending related products might not be optimal for your WooCommerce store. For example:
- Your store might not have enough products to show practical related product recommendations.
- Your store type and the products you sell might not be well-suited for related product recommendations.
- The WooCommerce related product widget is not working correctly, or the recommendations are not good enough, and you want to get rid of it.
WooCommerce does not make it easy to disable the recommended product feature, but luckily, there are quite a few different options. Some options will be as simple as pressing a button or activating a plugin, while others are a little bit more involved and might require some basic code knowledge. We’ll start with the more simple solutions.
Ways to Hide/ Disable/ Remove Related Products in WooCommerce?
There are several methods for hiding, disabling, or removing related products in WooCommerce:
- Using Theme Customization Options: Some WooCommerce themes provide options for controlling related products directly within the theme settings, enabling you to customize recommendations without writing code.
- Using the options in the WooCommerce dashboard: This method doesn’t remove related product recommendations but grants complete control over the products displayed in the related products widget by activating Cross-selling in WooCommerce, which allows manual linking and decision control.
- Plugin Solutions: Utilizing WooCommerce-specific plugins to hide related products. These plugins offer user-friendly interfaces for configuration.
- Custom PHP Code: Write custom code snippets in your theme’s functions.php file or via a custom plugin to filter and modify and hide product recommendations based on your specific criteria.
- Custom Styling: Use Cascading Style Sheets (CSS) to hide or style the display of related products in your store’s front end, thereby removing their visibility.
Each way to remove related products offers a means to customize the customer experience by managing related product suggestions, ensuring you can provide a more customized shopping journey for your WooCommerce customers.
Method 1: Using your theme customization options
This is the most straightforward way to remove the related products, but it depends on the WordPress theme you are using. If you are using a dedicated WooCommerce theme, the theme developers likely have created an option to turn off the WooCommerce related products on a single product page. Depending on your theme, this option is expected to be located under the single product page or somewhere in the themes options panel or the WordPress theme customizer panel. If this option is available in your theme options, then it’s just a matter of disabling this feature from your themes’ settings.
Method 2: From the WooCommerce dashboard
This method does not removing the related product recommendation by instead allowing you to have complete control over what WooCommerce products will show in the related products widget.
You see, the related products recommendation algorithm in WooCommerce uses various parameters to determine what product to recommend. Since this is an automated process, we have no control over it. To take over the product recommendation decisions, we need to activate the Cross-selling option in WooCommerce. This can be done directly via the WordPress dashboard.
Cross-selling products are linked together manually (by you), giving you complete control over what users will see under the related products.
The most effective product recommendations are those based on items frequently purchased together by customers, which requires analyzing WooCommerce data to identify common product pairings using the “Frequently Bought Together” report in Users Insights, located within the WooCommerce product sales report.
Method 3: Installing plugin to remove the related products
If you don’t want to deal with code and prefer to install a plugin to do the job for you, you might consider the NS Remove Related Products WordPress Plugin. This is an entirely free plugin that does the job. All you have to do is install and activate the plugin. Once active, you need to check the ‘Enabled Plugin” option in the plugin settings page and click Save Changes. This will automatically remove the related products from your WooCommerce store.
Method 4: Using PHP Code snippet
Since some WooCommerce themes may not provide an out-of-the-box option to control the related products recommendations, you might need to remove the recommended products by using a code snippet.
The code snippet can be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code Snippets plugin. You must add the code to your child theme, not your theme, as adding custom code directly to your parent theme’s functions.php file will be deleted the next time you update the theme.
/** * Remove related products output */ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
This code snippet should disable the related products from showing up. In fact, this code actually removes the related products action from being run on the page all together.
Method 5: Using CSS code
You can also use CSS to hide the related products output. You need the CSS code snippet below to put in your customizers’ “Additional CSS” view. Alternatively, if your theme option has a dedicated section to add custom CSS, you can add it there. The CSS code you need is:
.related.products {visibility:hidden;}
Generally, this is not the recommended way of hiding related products, as this CSS snippet is just hiding the related products from the website visitors. The actual PHP code is still running in the background and loading all the recommended products data. But the truth is it works and is easy to do for non-tech users.
Conclusion
You might not want to display the related products in the WooCommerce widget for many reasons. You may want to replace it with something of your own making or remove it altogether to improve the shopping experience. Thankfully, there are quite a few ways to remove the recommended products, and we have looked into the different methods with different levels of complexity. We hope you found this helpful article.