skip to Main Content

How to Add Related Products to WooCommerce Product Pages

How to Add Related Products to WooCommerce Product Pages

Table of Contents


Adding related products to your WooCommerce store helps improve user experience and increases sales by recommending relevant products to customers. It encourages buyers to explore more items and increases the average order value.


1. Default WooCommerce Related Products

WooCommerce automatically displays related products based on product categories and tags. You don’t need to configure anything for this feature to work.


2. Using Upsells and Cross-Sells

WooCommerce allows you to manually select products for upsells and cross-sells:

  • Upsells: Suggested alternatives to the current product (better versions or higher-priced items).
  • Cross-sells: Related products shown on the cart page to encourage additional purchases.
WooCommerce related products setup guide

To set this up:

  1. Go to Products > All Products in your WordPress dashboard.
  2. Edit the product where you want to add related products.
  3. Scroll down to the Product Data section.
  4. Click on the Linked Products tab.
  5. Add products to the Upsells and Cross-sells fields.
  6. Click Update to save changes.

3. Using a WooCommerce Plugin

Several plugins allow more customization for related products. Some popular options include:

  • Related Products for WooCommerce
  • WooCommerce Product Recommendations
  • YITH WooCommerce Frequently Bought Together

You can install these plugins from the WordPress plugin repository and follow their setup guides to customize related product displays.


If you want more control over how related products appear, you can add custom code to your theme’s functions.php file.

Example code to display specific related products:

add_action('woocommerce_after_single_product_summary', 'custom_related_products', 15);
function custom_related_products() {
    woocommerce_related_products(array(
        'posts_per_page' => 4,
        'columns' => 4,
    ));
}

This code displays four related products in a row below the product description.


Best Practices for Related Products

  • Ensure relevance by selecting related items carefully.
  • Use high-quality images and clear descriptions.
  • Avoid cluttering the page with too many recommendations.
  • Test different layouts to find the most effective placement.

FAQs

Can I disable related products in WooCommerce?

Yes, add this code to your functions.php file:
remove_action(‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);

How do I change the number of related products displayed?

Add this code to your functions.php file:
add_filter(‘woocommerce_output_related_products_args’, ‘change_related_products_count’);
function change_related_products_count($args) {
$args[‘posts_per_page’] = 4; // Adjust the number as needed
return $args;
}

Are related products the same as upsells and cross-sells?

No, related products are automatically generated based on categories and tags, whereas upsells and cross-sells are manually assigned.

I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top