“ Woocommerce hide related products ” is an issue for which lots of people searched. Hiding the whole products on your store is a piece of cake. However, in this article, I will help you understand more about related products, thus you can decide on hiding or focusing on them to improve your revenues.
Related products are a list of items that have similar or same price, vendor, category, etc. Or they may have no relevant relation but you want to showcase them together. Showing related products along with the currently viewed item is pretty beneficial. It will persuade your customers to purchase more. Normally, on the product detail page, there exist a main product, “add to cart” button, product description, and a list of related products.
If you want to Woocommerce hide related products, there are two recommended ways as follows:
First method: Apply CSS
This tactic is quite simple as you can use attribute display none. It can be done by all of you. Please follow these steps:
Step 1: Go to a page including related products > right click and select Inspect
Step 2: Select a class wrapping these products, copy the following class related-products-wrapper product-section
display : none !important;
You can absolutely ignore the above steps, copy the code snippet above and add to the end of the CSS file of the theme, and save. In order to make the changes, you can use the edit feature of the theme (however, this feature is unavailable in WordPress version 5.x.x and later ones) or apply FTP software such as phpdegnide, notepad ++ or use file edit feature of hosting.
Second method: Apply PHP code
This method is just suitable for people who are skillful in WordPress, Woocommerce. You should create a backup file so you can revert back if there is any problem with the changes. Now, open file function.php and add the code below to the end of the file.
remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20 );
Next, please reload the web page and check if it is updated. After that, please check all the functions to make sure there is no effect on your current functions. If yes, please remove the added code and find where the cause is. In case you cannot figure it out yourself, just find a developer for support.
I hope that the article about “ Woocommerce hide related products ” can help you. However, it had better if relevant products are recommended. They will help increase the conversion rate and improve your revenues as well. If you are working with Shopify platform, I would like to recommend this app Related Products It allows you to configure different relevant conditions such as Same vendor, Same collection, or Manual Recommendation for each products. Please refer to this link for more information.