How to create Filters with Attributes in WooCommerce

In this tutorial I will explain how to create filters with woocommerce attributes but first I am going to explain to you what attributes are and their difference with variations.

I admit that whenever I try to explain the difference between attributes and variations in WooCommerce I have a hard time 😅.

I think that variations and attributes are two of the most complicated options in WooCommerce.

Here is the table of contents in case you want to go directly to creating the filters:

Difference Between Attributes and Variations

Attributes: Attributes are product characteristics that you can use to:

  • Create filters on your website for those characteristics
  • Create product variations

But What are product variations?

Thanks to product variations we can make the attributes become different options that the customer can choose from a product.

Typical variations are the size and size of a garment.

For example, let's imagine that we sell a T-shirt that can be Red, Yellow and Blue and in turn can be Small, Medium or Large.

We can create an attribute that is Size and another attribute that is color.

If we only create the attributes we can create filters with those characteristics, but if we want a user to be able to choose between the different sizes and sizes we have to convert those attributes into product variations.

By the way, a very useful plugin to make the variations in the product sheet more attractive is Variation Swatches for WooCommerce. This plugin changes the dropdown to choose colors for buttons of the colors you want.

You can learn much more about the variations and how to create a store at our WooCommerce course

So we can create attributes without the need to create variations if all we want is for the customer to be able to filter in our store but instead we do not want product variations to be generated.

A use case for creating attributes without creating variations would be if we want users to be able to filter by product brand, fabric type, or any other feature of our product.

Difference between Attributes and Categories

You may be wondering, And why do I want to create attributes to create filters if I can do it with product categories?

And I understand your doubts, sometimes I have them myself 🙃

Imagine that you have a hygiene products store and you want to categorize your products by type of use, so you will create categories of the type: Shampoos, Gels, Moisturisers, Scrubs, etc.

But it is very likely that it will be very useful for the user to be able to filter by type of ingredient or active ingredient. So a good idea would be to create attributes with your components. Like for example Aloe Vera and other components.

Could you create it as a category? Yes, but it would be confusing to create categories with different criteria.

Create Filters with Attributes in WooCommerce

In this tutorial we will learn how to create a filter on our website so that customers can filter by the features we want:

Screenshot of a store in which we have added filters by the brand attribute

Create Attributes

The first thing we have to do is go to Products –> Attributes and create the attribute we need:

Screenshot in the Attributes option within Products

Within Attributes we create our general attribute or filter that we want to create:

Screenshot inside the attribute we are creating with the Add Attribute button highlighted

Once the attribute has been created, what we have to do is create the terms within that attribute. This is done from within the option Configure Terms:

Screenshot of the Configure terms option of our attribute

The terms are each of the options that we are going to use for our filters:

Screenshot of each term of our attribute

Once done we have to go to our products, edit them and add the attribute and the terms or filters that we need.

We edit our product and go down to the area Product dates and we select Attributes:

Screenshot creating a product in WooCommerce with the Product Data section highlighted

Now we add our new attribute:

Screenshot adding an attribute to a product

Once the attribute is added, we choose the term that we are going to use as a filter:

Screenshot adding the term for which we want to create a filter

Important: We won't check the Used for Variations option if we don't want it to become an option that we want the customer to be able to choose from. (This option only appears if we are creating a variable product)

We will not mark the option used for variations

Add the filters to the store

Now that we have created the filters we have to add them to our store.

We will do this thanks to the Widgets.

Screenshot of the WordPress backend with the Widgets option highlighted

We go to the widgets and add the Widget Filter by attribute:

Screenshot adding the Filter By Attribute widget

And we choose the term by which we want to filter:

Screenshot of the filter by attribute widget with the term Size selected

If all went well, you can now go to your store and you will see the fully functional filters:

screenshot of the store with the final result of creating filters with attributes in WooCommerce

If you have come this far you already have filters with the attributes of your products. All this without adding additional plugins.

We can also add a widget to see what filters we have activated

Best plugins to create Advanced Filters with WooCommerce

If you need more advanced features, there are extensions or plugins that improve the functionality of advanced filters.

Here are some of them.

I hope this tutorial has been useful to you.

Leave a comment