When it comes to e-commerce, engaging customers to add extra items to the shopping cart is always encouraged. That’s why WooCommerce allows you to show up related products on the product detail page by default, which helps up-sell and cross-sell the purchasers. Customers can view other products and properly increase the order sizes.
Unfortunately, these related products sometimes don’t function as effectively as what business owners expect. They might confuse the visitors which can lead to no sales at all.
For example, the buyer has put a pair of glasses in his cart, then he is recommended some other brandy glasses. This pushes him to start making some research about the new ones before deciding which to pay for. As a result, he might get distracted and leave without buying anything. And you lose that sale.
This article will show you how to manually remove related products in a single WooCommerce product page and also introduce some plugins to simplify this removal process.
Ways to Remove Related Products in WooCommerce
There are 2 paths you can take to disable related WooCommerce products, either inserting some lines of code to your theme’s functions.php file or installing a free plugin. Let’s get started with the first method.
Option 1: Editing the theme’s functions.php file
This method includes 2 main steps to turn off WooCommerce related products manually:
Step 1: Create a child theme
It’s necessary to create a child theme and make changes there since your custom code can be deleted when you update the parent theme.
You can go to your theme directory, create a new folder with a new name. Reference the detailed guide to create a child theme here.
Step 2: Add a few lines of code to your child theme’s functions.php file
Insert the following code to your theme’s fuctions.php file at the bottom of the file or right before the ?> ending tag:
/** * Remove related products output */ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
Editing the functions.php file is a developer-level method that requires you to be familiar with coding and themes. If you’re a non-tech savvy, think of a plugin to simplify the related product removal process.
Option 2: Using NS Remove Related Products for WooCommerce plugin
NS Remove Related Products for WooCommerce offers a complete solution to shield the related products from your shop page. All you need to do involves installing, activating, enabling the plugin and letting it handle the job.
- Go to Add New under Plugins in your WordPress dashboard menu
- Search for NS Remove Related Products for WooCommerce in the Keyword box
- Hit Install and Activate buttons
- Click on the Remove Related icon inserted in the sidebar
- Tick on Enabled Plugin then save your changes
Since the free version enables you to hide related WooCommerce products only, you need to upgrade to the Pro version to expand its features.
You can show or hide the related products not only for the public but also for registered users. And it’s possible to adjust the number of shown products through the “Number of related product” option.
What’s more, instead of displaying products randomly, you can arrange them by product IDs, inserted date, modified date, or by title. Ordering WooCommerce products by ASC (from top to bottom) and DESC (from bottom to top) is available, too.
In case you don’t want to shield related products on all the product pages but some specific pages, head to individual pages and make changes there.
What If You Intend to Protect WooCommerce Products?
There might be times you want to do more than just hiding related products. Some products need protecting so that only authorized or premium users/customers are able to access and make purchases. For instance, you sell adult products or services such as tobacco. Password protect these types of products prevent underage visitors from accessing them.
A password protection plugin comes into play in this case. Your products won’t be listed publicly in your WooCommerce store. Only those with the correct passwords are able to view the private products.
Among numerous password protection plugins out there, Password Protect WordPress Pro proves one of the most effective solutions. The plugin allows you to lock WooCommerce products with a password. You can protect product pages with some simple clicks.
How to password protect WooCOmmerce products with PPWP Pro
Upon installation (similar to the first 3 steps of installing NS Remove Related Products for WooCommerce plugin), the plugin is added directly to your WordPress dashboard navigation menu. To get started password protecting WooCommerce products, follow the 6-step guide below:
- Click Password Protect WordPress to visit the Settings page
- Select Products in the Post Type Protection section
- Save your changes
- Head to Products under WooCommerce → All Products and choose your desired product page
- Hover the product name and click Edit
- Toggle the option Password protected on the top right side of the editing screen
Your product page is assigned a password now. In other words, it won’t show up in your WooCommerce store and on any search results pages. If you want to allow users to see the private product on Google and other search engines, just switch off the option Block Search Indexing.
There are a lot more you can do with the protected page through PPWP Pro. You can set cookies expiration which authorizes users to access the protected products in a certain period of time without re-entering passwords. The default period is 7 days.
Whitelisted roles, including Admins, Page’s Author, or a Login user, etc can view the secure products without a password request. Just leave No one when you would like all types of users to fill in the password form.
On top of that, all child product pages will be automatically locked once you protect their parent product page. The same thing goes for product categories and their posts.
Take Actions to Remove WooCommerce Related Products
There are different methods, both technical and non-technical, you can apply to disable related products on WooCommerce single product pages. While adding code requires you to make changes to the theme’s functions.php file, NS Remove Related Products for WooCommerce plugin proves to be a better and more efficient solution.
In case you don’t intend to hide related products but protect WooCommerce products from the public view, give Password Protect WordPress Pro a try. Only those with the correct password are permitted to view the private products.
If you have any questions about how to remove related products or protect WooCommerce products, let us know in the comment section below!