Knowledge Base

WooCommerce Related Products By Attributes

WooCommerce Related Products By Attributes

Hi there, and welcome to this introduction to the WPupgrader ‘WooCommerce, related by attributes plugin’ tutorial.

By default, WooCommerce will show a number of related items at the bottom of a product page, provided your Theme supports these, or you are using the WooCommerce shortcode to display the related products on a product page. 

These products are found by WooCommerce by looking for other products that share a category with the product that is being viewed.

However, you may find that the products shown are not the one’s you actually want to be advertising at the bottom of that product page; you may want to show products that are related by size, color or season instead. 

This plugin provides you with options to finetune how related products are selected, by allowing you to create relationships based on attributes instead of only categories.

We will look at the settings you can configure as well as where you need to go in your product configuration to set up attributes for your products and product variations.

With that introduction out of the way, let’s get into this plugin!


Setting up

This plugin requires that you have a few things setup in advance to work. You will need to have a WordPress website, installed with WooCommerce and a catalog with products. To find out which versions of WordPress and WooCommerce are supported, pop over the and check the knowledgebase to see minimal required versions of WordPress and WooCommerce.

You will also need to have a number of products set up in your WooCommerce that have attributes configured. If you just want to test this plugin, you can setup a site with WooCommerce and import a set of test data straight from the WooCommerce installation package. These items already have some attributes set up like color and sizes. We will be using this test set for the rest of this video.


Installing the plugin

Installing the plugin is as simple as most other plugins. Simply go to plugins, add new and select the package you downloaded from Once installation is complete, be sure to pop your license key into the plugin. You can do this by going to ‘Settings’ adn then ‘WooCommerce Related Products by Attributes License’.


Configuring the plugin.

All the configuration for this plugin is now available within WooCommerce. Go to:

WooCommerce > Settings > Tab ‘Products’ and scroll down to the section called ‘Related Products by Attributes’ 


Attribute Priority

For each attribute you have defined for your WooCommerce products, you can set the weight of how important that attribute is to display any related products. If a value is set to 0, that attribute will not be used to find related products. 

If you would like color to be more important than size in the matching, set Color to ‘2’ and ‘Size’ to ‘1’. The higher the number, the more importance is assigned to this attribute during matching. This can be done for up to 99 different attributes.  

Per attribute we display how many different terms are found for that attribute to help you understand how valuable it would be to give that attribute more priority. In general, you will want to assign more priority to attributes that have more terms in them.


Matching level 

Set the slider towards ‘Strict’ to select more products that have a high rate of matching the attributes with a priority value as set above. Set the slider towards ‘Loose’ to have more, but maybe less precise matches. If you set the slider all the way to the left, so to low, you are effectively disabling matching level. This means any product that shares an attribute may be selected, regardless of the attribute priority.


Fallback Methods

The plugin by default will now start showing related products based on matching attributes. However, you may not have enough results to show only products related by attributes. 

Therefor the plugin allows you to turn on fallback methods like ‘relate by category’ as an additional way to first find products related by attribute and then to supplement that with products from a related category.

You can also turn on ‘relate by tags’ which work in the same way; It will add in additional products that share similar tags if there are not enough products found through attribute relationships. 


Randomise results

After all the rules above have been applied, a set of products has been selected to show as the related products with the main product. 

By activating the ‘Randomise results’ option, the selected set will be shown in a random order, as WooCommerce does in its original way to show related products. 

Keep in mind that turning this on changes the display order of the products each time you reload the product page. So turn this on, only if your intention is to have a slightly visually changing order of products when the same page is reloaded.


Informational message

This option will display an additional box with information about the results founds on the page that you are displaying the related products on, usually the WooCommerce product page. Turn this on if you are not seeing enough products shown; it will help you understand if you have set your settings too strict, limiting the number of related products being shown. This will only be shown if you are logged in to WordPress and have an adminstrator level account.


A note about displaying product variations

With WooCommerce it is possible to set up an alternative image for each variant you have. However, it is only possible to show the main image, or the image of the first variant, when we show a related product. Also changing an atribute on a product page to show a variant for a product will not change the already displayed variants for that product; related products are loaded when the page is loaded and can, alas, not be changed dynamically with WooCommerce.