How to Hide Related Products In WooCommerce?

12 minutes read

To hide related products in WooCommerce, you can modify the code in your theme's functions.php file or use a custom CSS code snippet. Here's how:

  1. Option 1: Modify functions.php file: Open your theme's functions.php file in a text editor. Add the following code at the end of the file: function remove_related_products() { remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); } add_action( 'after_setup_theme', 'remove_related_products' ); Save the file and upload it back to your server.
  2. Option 2: Custom CSS: Install and activate a CSS customizer plugin (e.g., Simple Custom CSS and JS). Navigate to your WordPress dashboard and find the new customization options provided by the plugin. Add the following CSS code snippet: .woocommerce .related.products { display: none; } Save the changes.


Using either of these methods will hide the related products section on the WooCommerce single product pages.

Best WooCommerce Hosting Providers in 2024

1
Vultr

Rating is 5 out of 5

Vultr

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

Rating is 4.9 out of 5

Digital Ocean

  • Active Digital Community
  • Simple Control Panel
  • Starting from 5$ per month


Will hiding related products affect cross-selling or upselling efforts?

Hiding related products can potentially affect cross-selling or upselling efforts. These techniques rely on showcasing related items to customers, encouraging them to make additional or more expensive purchases.


When related products are hidden, customers may miss out on discovering complementary or upgraded items they may be interested in. This could result in lower cross-selling or upselling success rates, as customers are not exposed to these additional options.


It is important to strike a balance between providing visibility for related products and not overwhelming customers with too many choices. Designing an effective product display system, employing personalized recommendations, or strategically timed offers can help mitigate any negative impact of hidden related products on cross-selling or upselling efforts.


What are the benefits of hiding related products?

There are several benefits to hiding related products on an eCommerce website. Some of them include:

  1. Improved User Experience: By hiding related products, you can reduce clutter on the product page and provide a cleaner and more focused interface for the users. This enhances the overall user experience as it allows customers to easily find and focus on the product they are interested in without distractions.
  2. Avoid Confusion: Displaying too many related products can overwhelm customers and create confusion, especially if the recommendations are not relevant or do not align with the customer's preferences. By hiding related products, you prevent information overload and make it easier for customers to make a decision.
  3. Faster Load Times: Showing related products often involves making additional server requests to load the data. Hiding them can help improve website performance and loading times, ensuring that users have a fast and smooth browsing experience.
  4. Increased Conversion Rates: By reducing distractions and streamlining the purchasing process, hiding related products can help to improve conversion rates. When customers can focus on the specific product without being sidetracked, they are more likely to complete the purchase.
  5. Customization and Personalization: Hiding related products allows for a more personalized shopping experience. Businesses can use customer data and preferences to display relevant related products to specific users, ensuring that the recommendations are truly tailored to their interests.
  6. Aesthetic Appeal: Hiding related products can make the product page appear more visually appealing. By showcasing the main product in a clean and uncluttered manner, it can enhance its visual impact and increase its perceived value.


Overall, hiding related products can enhance the user experience, improve website performance, and increase conversion rates, ultimately benefiting both customers and businesses.


Is it possible to replace the related products section with something else?

Yes, it is possible to replace the related products section with something else. The related products section is typically a feature provided by e-commerce platforms to suggest products that are relevant or complementary to the one being viewed by customers. However, the layout and content of the website can generally be customized to meet specific requirements and preferences. By modifying the website's template or using custom coding, you can replace the related products section with alternative content such as testimonials, customer reviews, social media feeds, promotional offers, or any other relevant information that you want to showcase.

Top Rated WooCommerce Books in 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
The Web Developer's Guide to WordPress: Learn how to create WooCommerce compatible, customizable and redistributable themes

Rating is 4.9 out of 5

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

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 (The Explained Series)

Rating is 4.7 out of 5

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

5
Create a WordPress Course & Event Bookings Website with The Events Calendar & WooCommerce: How to promote & sell your events in less than 1 day - no coding needed!

Rating is 4.6 out of 5

Create a WordPress Course & Event Bookings Website with The Events Calendar & WooCommerce: How to promote & sell your events in less than 1 day - no coding needed!

6
Sell Your Product Using WooCommerce + DIVI: Master the art of selling products through your website

Rating is 4.5 out of 5

Sell Your Product Using WooCommerce + DIVI: Master the art of selling products through your website

7
ECOMMERCE BIBLE: The Ultimate Guide of e-Commerce, Shopify, WooCommerce, Dropshipping, Amazon FBA

Rating is 4.4 out of 5

ECOMMERCE BIBLE: The Ultimate Guide of e-Commerce, Shopify, WooCommerce, Dropshipping, Amazon FBA


Are there any WooCommerce hooks or filters that can be used to hide related products?

Yes, there are WooCommerce hooks and filters that can be used to hide related products. The woocommerce_related_products hook can be used to modify the related products displayed on a single product page. You can remove the related products altogether by unhooking the default related products function:

1
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );


Alternatively, you can modify the related products query to exclude certain products or criteria using the woocommerce_related_products_args filter. Here's an example of how you can modify the query to hide related products based on a specific category:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
add_filter( 'woocommerce_related_products_args', 'hide_related_products_by_category', 10, 1 );
function hide_related_products_by_category( $args ) {
    global $product;

    $terms = wp_get_post_terms( $product->get_id(), 'product_cat', array( 'fields' => 'ids' ) );

    $args['tax_query'][] = array(
        'taxonomy' => 'product_cat',
        'field' => 'term_id',
        'terms' => $terms,
        'operator' => 'NOT IN',
    );

    return $args;
}


By using the woocommerce_related_products_args filter, you can customize the related products query to match your specific requirements and hide the related products accordingly.


Can I hide related products for specific product types, such as variable products?

Yes, you can hide related products for specific product types, such as variable products, in most e-commerce platforms like WooCommerce. By default, WooCommerce includes a Related Products section on product pages to showcase similar items. However, you can customize this feature or even remove it entirely for specific product types.


To achieve this, you may need to modify your theme or write some custom code. Here's an example of how you can hide related products for variable products in WooCommerce by adding code to your theme's functions.php file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function remove_related_products_for_variable_product() {
    global $product;

    // Check if the product is a variable product
    if ( $product->is_type( 'variable' ) ) {
        // Remove related products completely
        remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
    }
}
add_action( 'woocommerce_before_single_product_summary', 'remove_related_products_for_variable_product', 1 );


In this code snippet, the remove_related_products_for_variable_product function checks if the current product is of the variable type and removes the related products section accordingly.


Make sure to backup your theme files and test this code on a staging site before implementing it on your live website. If you're not comfortable with editing code, you can also consider using WooCommerce extensions or plugins that provide more control over related products visibility.


Can I hide related products on specific product pages?

Yes, you can hide related products on specific product pages on most e-commerce platforms. This functionality may vary depending on the platform you are using, but typically there are options to control the display of related products.


For example, in popular platforms like WooCommerce, Shopify, Magento, or BigCommerce, you can usually disable or hide related products from specific product pages through the platform's settings or by using custom code. You may need to edit the page template or modify the product settings to remove the display of related products.


It is recommended to refer to the documentation or support resources of your specific e-commerce platform to find detailed instructions on how to hide related products on specific product pages.


Is it necessary to backup my site before making changes to hide related products?

It is always a good practice to create a backup of your website before making any significant changes. This provides you with a safety net in case something goes wrong during the process. While hiding related products might not be a complex change, there is still a possibility of unintentional errors or unexpected issues arising. By having a backup, you can easily revert back to the previous version of your website if needed.

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

To integrate WooCommerce into Shopify, you can follow these steps:Export your products from WooCommerce: Begin by exporting your products data from your WooCommerce store. This can usually be done through a CSV export feature or using a WooCommerce plugin spec...
To export WooCommerce products with images, you can follow these steps:Go to your WordPress dashboard and navigate to the WooCommerce section.Click on the "Products" tab and select "All Products" from the dropdown menu.On the All Products page,...
To hide uncategorized categories in WooCommerce, you can follow these steps:Log in to the WordPress admin area of your website.Go to WooCommerce and click on "Products" in the sidebar menu.Click on "Categories" to view the list of available cat...