Uncategorized

How to Change the Order of Product Attributes in WooCommerce

Attribute order is set in two places: per product on the Attributes tab, and per global attribute under Products > Attributes. Steps, sort options and verified code for WooCommerce 11.3.

·11 min read
Four colored attribute chips labelled Size, Color, Material and Brand lined up beside numbered slots, with the Color chip being dragged into second place

There are two separate orders in WooCommerce, and most confusion comes from mixing them up. The order of the attributes themselves (Size before Color) is set per product, by dragging rows on the product’s Attributes tab. The order of the values inside a global attribute (S, M, L, XL) is set once for the whole store, under Products > Attributes, with the attribute’s Default sort order and, for hand-picked sequences, the Custom ordering option.

We checked the steps and option names below against the WooCommerce product taxonomies guide, the variable product guide and the WooCommerce source code on 15 November 2026. The current release on WordPress.org that day was WooCommerce 11.3.0. Everything here uses the classic product form, which is the only editor left in current versions (more on that in the next section).

If you landed here searching for a way to create sequential attributes, such as shoe sizes 36 to 46, or to sort attribute values that contain numbers, jump to the sections on sequential attributes and numeric sorting. They answer the two most common follow-up questions.

Which order do you need to change?

Pick the row that matches your problem. Each one lives in a different place, and fixing the wrong one is why changes seem to do nothing.

You want to change

Where you do it

Applies to

Which attribute shows first on one product (Size above Color)

Product data > Attributes tab, drag the row, then Save attributes

That product only

Order of values inside a global attribute (S, M, L, XL)

Products > Attributes > Configure terms, with the attribute set to Custom ordering

Every product that uses the attribute

How values sort automatically (A to Z, numbers, creation order)

Products > Attributes, edit the attribute, Default sort order

Every product that uses the attribute

Order of values on a per-product custom attribute

Retype the values in the order you want, separated by a pipe

That product only

Order of the dropdowns on the product page

Follows the attribute order on the product

That product only

Order of variations in the admin list

Variations tab, drag the handle

Admin only, not shown to shoppers

Does the new product editor change any of this?

No, because it is gone. WooCommerce’s own new product editor page says the experimental block-based editor was deprecated in WooCommerce 10.9 and removed in WooCommerce 11.0, and that stores on 11.0 or later use the classic editor. Older tutorials that describe an Organization tab for attributes were written for that beta. On a current store you work with the Product data box and its Attributes tab.

If your store is still on a version older than 11.0 and you switched the beta editor on, turn it off in the product settings before following the steps below, or you will not see the drag handles described here.

How do I change the order of product attributes on one product?

Open the product in the classic editor and scroll to the Product data box. This works for simple and variable products alike, and it does not touch any other product.

  1. Edit the product and open the Attributes tab in the Product data box.
  2. Drag the attribute rows into the order you want shoppers to see.
  3. Click Save attributes.
  4. Click Update (or Publish) on the product, then reload the product page.

The saved position is stored with the product, and the product object sorts its attributes by that position every time it loads. That is why the new order shows up in two places: the Additional information tab and, on variable products, the dropdown selectors above the Add to cart button. The variable product guide says shoppers see the selection fields in the order you set here.

Two details catch people out. First, the order is per product, so a store with 800 products needs 800 edits unless you use a bulk tool, and any bulk tool deserves a test on a staging copy first. Second, if the product has weight or dimensions, WooCommerce prints those rows first on the Additional information tab, before any attribute. You cannot drag an attribute above them from the product screen.

How do I order the values inside a global attribute?

Global attributes are the ones you create under Products > Attributes, and they hold a list of terms, such as Small, Medium and Large. Their order is controlled by one setting called Default sort order. The edit screen offers four choices, and you can confirm the labels in the WooCommerce source file that renders the form.

Option

What it does

Use it for

Custom ordering

You drag the terms into the order you want

Sizes (S, M, L, XL), editions, anything with a fixed sequence

Name

Sorts the term names alphabetically

Colors, brands, materials

Name (numeric)

Sorts the term names as numbers

Shoe sizes, screen sizes, quantities

Term ID

Sorts by creation order, oldest term first

Values you added in the exact order you want them

To set a hand-picked order:

  1. Go to Products > Attributes.
  2. Edit the attribute (or create it) and set Default sort order to Custom ordering, then save.
  3. Click Configure terms in the attribute’s row.
  4. On the Edit Attribute screen, drag the terms into order. The change saves as you drop each one.
  5. Reload a product page that uses the attribute and check the dropdown.

Dragging only works when the attribute is set to Custom ordering. If you drag terms while the attribute sorts by Name, the saved positions exist but WooCommerce ignores them. The same screen is also where you add a new term and place it in the sequence at the moment you create it.

Changing the sort order is a store-wide change on purpose. Every product that uses the attribute follows it, and when you add values to a product with Select all they are added in the attribute’s sort order. You do not need to open each product afterwards.

How do I create sequential attributes in WooCommerce?

This was the top search that reached this page: people want an attribute whose values run in a sequence, such as 36, 37, 38 up to 46, or Week 1 to Week 12. WooCommerce has no button that generates a range of values. You create the terms, then choose how they sort. There are three ways to do it.

Option 1: add terms in order and sort by Term ID

Set the attribute’s Default sort order to Term ID, then add the terms one at a time in the order you want. Each new term gets a higher ID than the one before, so the sequence holds. This is the cheapest option when the list is short and never changes. It breaks the moment you need to insert a value in the middle, because the new term always lands at the end.

Option 2: use numeric names and Name (numeric)

If the term names are plain numbers, set the sort order to Name (numeric). Add the terms in any order and WooCommerce lines them up from smallest to largest. Inserting 42.5 later puts it between 42 and 43 with no dragging. This is the right choice for shoe sizes, lens sizes and similar scales.

Option 3: create many terms at once with WP-CLI

For a long run of values, WP-CLI creates terms faster than the admin form. The taxonomy name is the attribute slug with a pa_ prefix, so an attribute with the slug shoe-size has the taxonomy pa_shoe-size. Create the attribute in the admin first, then run this in your site folder:

# Creates terms 36 to 46 in the Shoe size attribute (slug: shoe-size)
for n in $(seq 36 46); do
  wp term create pa_shoe-size "$n"
done

Set the attribute to Name (numeric) or Term ID afterwards, depending on whether you may insert values later. Run it on a staging copy first and check the terms in the admin before you repeat it on the live store.

How do I sort attribute values that start or end with a number?

Search Console shows people asking about attributes that start or end with a number. We read that as a sorting problem, and the answer depends on where the number sits in the name.

The Name (numeric) option works by casting the term name to a number in the database query. The WooCommerce code adds +0 to the name column when it sorts (see the term functions file). In MySQL, a text value that begins with digits is read as those digits, and a text value that does not begin with a digit counts as zero. So the position of the number decides the result.

Term names

Name (numeric) result

Better option

36, 37, 38, 40

Sorted correctly

Name (numeric)

10 inch, 12 inch, 9 inch

Sorted by the leading number: 9, 10, 12

Name (numeric)

Size 10, Size 12, Size 9

All read as zero, so the order is unreliable

Custom ordering, or rename the terms to start with the number

S, M, L, XL

All read as zero

Custom ordering

1, 10, 2, 20 under plain Name

Alphabetical: 1, 10, 2, 20

Switch to Name (numeric)

If a term ends with the number, either rename it so the number comes first or switch that attribute to Custom ordering and drag the terms. Renaming is fine when you control the data. Custom ordering is safer when the names come from a supplier feed you cannot change.

How do I set the order of the variation dropdowns?

The dropdowns on a variable product page are built from the product’s attributes and their terms, not from the variations list. That one fact explains a long run of forum questions. In a WordPress.org thread from 2016, a user dragged variations around the editor and nothing changed on the product page. A WooCommerce support engineer answered that variation order does not control what shoppers see: attribute order does, and for global attributes the terms are sorted under Products > Attributes.

So you control the dropdowns with two settings you already know:

  • Which dropdown comes first: drag the attribute rows on the product’s Attributes tab.
  • Which value comes first inside a dropdown: sort the global attribute’s terms, or for a per-product custom attribute, retype the values in the order you want.

Custom attributes are the exception to the store-wide rule. You create them on the product with the Add new button and type the values separated by a pipe, like Small | Medium | Large. They show in the order you typed them. To reorder, retype the list and save.

Does the order of the variations themselves matter?

Yes, but only behind the scenes. On the Variations tab you can drag a variation by its handle, or click the handle and type a position number. Shoppers never see that order. It matters when you use an Any option, such as a variation set to Any Color. WooCommerce’s variable product guide says the more specific variations should come first.

Can I reorder attributes with code?

You can, and for most stores you should not need to. Use the admin screens first, because they cover every case above and survive theme changes. Code is worth it when you maintain many sites, when a feed rewrites your attributes, or when you want a rule to apply to a whole class of attributes.

Two hooks are safe because we confirmed them in the WooCommerce source on 15 November 2026. Neither one is the snippet that used to sit on this page, which passed an array of query arguments to a filter that only ever receives a single text value.

Force a sort order for one attribute

The woocommerce_attribute_orderby filter in the attribute functions file receives the attribute’s saved sort setting as a string and the attribute slug without the pa_ prefix. The values are the ones the dropdown stores: menu_order for Custom ordering, name, name_num and id. Return one of them:

add_filter( 'woocommerce_attribute_orderby', function ( $orderby, $slug ) {
	if ( 'shoe-size' === $slug ) {
		return 'name_num'; // Always sort shoe sizes as numbers.
	}
	return $orderby;
}, 10, 2 );

This overrides whatever is saved in the admin for that one attribute. Add a comment in your code explaining why, or the next person to open the Attributes screen will wonder why their change has no effect.

Reorder the rows on the Additional information tab

The woocommerce_display_product_attributes filter receives the list of rows the tab will print. Each row is keyed by attribute_ plus the taxonomy name, and weight and dimensions use the keys weight and dimensions. This example moves Size to the top, above everything else:

add_filter( 'woocommerce_display_product_attributes', function ( $rows ) {
	$key = 'attribute_pa_size';
	if ( isset( $rows[ $key ] ) ) {
		$rows = array( $key => $rows[ $key ] ) + $rows;
	}
	return $rows;
} );

This changes only the display table. It does not change the dropdown order on variable products, which comes from the attribute positions and term order described earlier. Put these snippets in a small plugin or a child theme, never in a file that a theme update replaces, and test them on a staging copy first.

Both snippets are short, and the filter names and argument shapes match the trunk source we read on 15 November 2026. Test them on your own store before you rely on them, since themes and filter plugins sometimes rebuild these lists.

Common mistakes people report

These are recurring problems from WordPress.org support threads and the official guides. We read each source on 15 November 2026 and paraphrased it. Most of the threads are old, so we checked each cause against the current documentation and source code where we could.

  • Dragging variations and expecting the dropdown to change. A 2016 support thread and a 2017 thread on variation order both end the same way: the dropdown follows the attribute terms, not the variations list.
  • Editing the wrong sort setting. In a thread about 67 terms that would not sort, the poster changed the setting on the Add attribute form, which only applies to attributes created afterwards. Existing attributes have their own Default sort order on the edit screen for that attribute.
  • Numbers sorting as 1, 10, 5. A reply in the 2016 thread above reports exactly that. The cause is the Name option sorting text, and the fix is Name (numeric), subject to the leading-number rule in the table earlier.
  • Another plugin or theme overriding the dropdown. In a 2025 thread, a Yarn Weight dropdown went alphabetical on every product, and the cause turned out to be a conflict with an unrelated plugin. Disabling plugins one at a time on a staging copy found it.
  • Looking for a drag handle on custom attribute values. The values of a per-product custom attribute show in the order you typed them. The WooCommerce variable product guide says to delete the values and enter them again in the new order.
  • Pasting an old filter snippet. Older tutorials, including the earlier version of this page, show woocommerce_attribute_orderby receiving an array of query arguments. The source shows it receives a single sort value and a slug. An array returned from it will not do what the tutorial promises.

What to check when the order will not change

Symptom

Most likely cause

Fix

Dragged terms, nothing changed on the product page

Attribute is not set to Custom ordering

Edit the attribute, set Custom ordering, save, drag again

Dropdown is alphabetical on every product

Sort set to Name, or a theme or plugin rebuilds the list

Check the sort setting, then disable plugins one by one on staging

Numbers sort as 1, 10, 2

Sort set to Name

Switch to Name (numeric)

Size comes after Color on one product

Attribute rows on that product are in that order

Drag the rows on the product’s Attributes tab and save

Old order still shows after saving

A page cache or object cache is serving old HTML

Purge the cache for the product page and test while logged out

Custom attribute values in the wrong order

Per-product values follow typing order

Retype them in the right order and save

When a long term list spans several admin pages, drag within one page at a time. One older thread reports that terms dragged on a long list landed at the start or end of a page, so check the result on the product page after each batch.

FAQ

Can I sort attributes alphabetically across the whole store?

You set that per attribute, not store-wide. Edit each global attribute and choose Name as its Default sort order. A code filter on the attribute sort setting can apply a rule to several attributes at once.

Will changing the sort order break existing products?

No. The sort order is read when the page builds, so the new order applies to existing products straight away. Orders and variations already saved are not rewritten. Clear any page cache so shoppers see the change.

Why does one product ignore my global order?

That product probably uses a custom attribute instead of the global one. Custom attributes belong to the product and sort by the text you typed. Convert it to the global attribute if you want the store-wide order.

Can shoppers sort a product list by attribute?

The Default sort order setting only decides how terms are listed. It does not add an attribute sorting option to the shop’s sort dropdown. Filter and swatch plugins have their own sort options, so check their settings if a filter list is in the wrong order.

Where to go next

Attribute order is one small part of keeping a large catalog usable. If you run a big store, the notes in our guide to scaling WooCommerce past 100K products cover what attribute-heavy catalogs do to query speed. If attributes drive your filtering, such as a year, make and model lookup, read our automotive parts filtering walkthrough.

Two related how-tos: limiting how many units a customer can buy per attribute option is in our guide to restricting quantity per product attribute, and the structure behind variable products is in our write-up on custom WooCommerce product types.

Last checked 15 November 2026 against WooCommerce 11.3.0 and the trunk source. Menu labels can shift between releases, so if a screen looks different on your store, the official guides linked above show the current wording.

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com