How to Use Product Attributes in WooCommerce

As discussed in the full guide about adding products in WooCommerce, Attributes can be used for important product distinctions such as color or size as well as providing more technical information about your products and setting variables. In this article, you’ll learn more about how to use product attributes in WooCommerce.

Attributes function similarly to Categories in WordPress. However, in this case Attributes are applied to Products as Cateogories are assigned to Posts or Pages in WordPress.

Using Predefined Attributes or Custom Attributes, How to Decide?

WooCommerce allows you to set global attributes that can be applied later to any new or existing products. For example, a common predefined attribute for a clothing store would be sizes. Instead of setting a size attribute for each new product, you can have Size predefined as a repeating attribute.

Conversely, custom attributes can be created as needed. For example, if you are selling “Smasho” available in three varieties of “Heat” — regular, hot, and boiling — then a custom, non-repeating attribute will meet your needs. Of course, setting a custom “Heat” attribute assumes that “Smasho” is the only product available with a “Heat” attribute.

If you eventually have many products requiring the same custom attribute then you may want to consider predefining the repeating attribute.

How to Add Predefined Attributes to Your Store

In your WordPress admin panel find the Products tab and choose Attributes below.

You will see the Add New Attribute interface.

  1. Under Name fill in the name of the attribute
  2. For Type you can choose Select or Text. Select will allow pre-configured values to display automatically in a dropdown menu. Text will allow you to manually enter values later.
  3. Click Add Attribute

If you chose Select for Type you may now select your attribute to configure the attribute values. You will notice the attribute you created in the table at the top right of the Add New Attribute window.

To add the attribute values:

  1. Choose your new attribute at the top right
  2. Under Add New ___ name the value
  3. Click Add New ___ at the bottom

How to Add Custom Attributes to Individual Products

As discussed above, you may find it preferable to assign a custom attribute to a unique product as needed rather than going through the above-described procedure of setting pre-configured attributes.

For example, your store may sell a variety of different items that do not share common attributes. For those types of products you can set custom attributes in the Product Data menu.

  1. Go to your WordPress admin panel
  2. Select a product or Add New Product
  3. Scroll down to the Product Data section
  4. Click Attributes
  5. The dropdown menu for “Custom product attribute” is already selected
  6. Click Add
  7. Name your Attribute and add your values. Make sure to separate each value with a pipe (|). For example: Small | Medium | Large
  8. Click Save Attributes

Thoughts on “How to Use Product Attributes in WooCommerce

  • I just want to say thanks a mill, this is one of the only threads out of the internet thats actually helpful. So many idiots posting misguided and irrelevant content. So you guys rock ! Will host my next site with you hands down !

  • I have a variable product example Shoe. I already have an attribute called Shoe type with two Item list: Custom and Ready made. In the checking out page I want it to be in a manner that if customer select Custom it should display another option list which will not be visible if it is Readymade the customer select

    • Unfortunately, I do not see a setting in the attributes that will allow you to configure what is displayed/visible when one option is selected over another.

  • How do i make the custom attribute apply to all products instead of adding them all one by one to hundreds of products? Or, preferably, have the attribute apply to certain categories.

    • You can use the “predefined” attributes as explained above, but those would need to still be added manually when creating a product. As a faster alternative, you can put your products into a spreadsheet, export to CSV and import the CSV file into WooCommerce. That way, you can copy/paste your attributes quickly across hundreds of products. This may save you some input time.

  • I want to set up a variable product with a couple attributes that are selected, but other attributes tied to the product that are not selectable. Generic things like the size and other specs. Is that possible? My goal is to display all of the product specs in a table while only having a couple attributes that are used to build the variations.

    • I’m not sure I understand the request exactly. If the attribute is not selectable, would it be more appropriate to put it in the product description? Or if not, perhaps adding one attribute as a value (which would make it only a single selection and thus selected by default.

  • Dears,

    How can I set specific price for each attribute, for example we have an item has 3 sizes (S/M/L) and S is $10, M is $15 and L is $20 .. how can we set this up ??? thanks

    • If you are providing comparison functionality with your WooCommerce site and you are not coding it yourself, then you will need to use a 3rd party plugin to quickly resolve it. Here’s an example of one option that you can try: WooCommerce Products Compare. There are numerous plugins, make sure that you find the one that matches and supports your installed version of WooCommerce.

  • How i can filter  Custom product attribute and is there any plugin can help in this functionality?

    thanks

    • I’m sorry but I’m not quite sure what it is you are trying to ask in regards to filters for product attributes. Can you please clarify what you mean?

  • I think what he meant is when creating new product, under attributes tab, all the attributes already been displayed instead of adding 1 by 1 from the list.

    • This issue appears to be theme related. Check out this post with WooCommerce support. They will be able to help you resolve the issue.


  • hello how can I insert an empty text field as an attribute? For example, if a customer wants to have the name engraved on a necklace, he needs to insert the name he wants in an empty text field. is this possible? Thank you

  • Hi!

    It is possible to load a function when a customer uses attributes?

    I want to load an image when customer select different colour or product.

    • Hello,

      We’re not completely sure what you are trying to do based on what you have said in your question. My recommendation is that if you’re doing something that is not part of the normal functionality of the WooCommerce plugin, then you should ask WooCommerce directly, as they are the developers of that plugin and give you a definitive answer. Check out this this post for possible feedback regarding your question.

  • Is there a way I can have the attributes show up automatically when adding a product instead of having to add each attribute every time? Thanks

    • Yes, it is possible. In this article, we mention predefined attributes, like size, for clothing, for example, which can be predefined and used over and over again.

  • What do you do when there is no option for Step 5? When I go to Attributes there is nothing there to select even after I have changed the product type to Variable Product.

    1. The dropdown menu for “Custom product attribute” is already selected
    • That is certainly strange. You will want to make sure which kind of product you’re editing, with regard to whether it is set to “simple product” or “variable product.”

Leave a Reply