How to Sort a Shopify Collection by Metafield Value

Quick answer: Shopify can't sort a collection by a metafield: its sort orders are best selling, alphabetical, price, date created, most relevant and manual, and none of them reads a custom field. You can drag products into order by hand, or use an app. Jedi ‑ Collection Sort Pro, which has a free plan, sorts a whole collection by a product metafield (a number, decimal, date, date and time or single line text), high to low or low to high, and keeps that order as products and values change.

Why sort a collection by a metafield

Metafields hold the facts Shopify's own fields don't: a release date, a season, a priority number your team agrees on, a pack size, a strength or a score. Sorting by one lets a collection follow your merchandising plan instead of the date a product happened to be created.

A launch is the classic case. You create products weeks ahead so they're ready, and Shopify's date sort then treats them as older than products added since. A release date field puts them first on the day they go live. A priority field does the same for a hand-picked order: your team ranks 300 products in one bulk edit instead of dragging each one into place.

What Shopify does and doesn't do

Shopify sorts each collection in one of six orders: best selling, alphabetical, price, date created, most relevant or manual. None of them reads a metafield. The sort menu shoppers see on your collection pages is built from the same fixed list, so a theme can't add a "sort by release date" option that works across the whole collection.

Metafields do work in storefront filters, which you set up in Shopify's Search & Discovery app, so shoppers can narrow a collection by a metafield. Filtering doesn't change the order, though. Theme code can reorder products with Liquid or JavaScript, but only the products already loaded on the page (50 by default, 250 at most), so page two is never sorted against page one.

Your options

OptionWhat it doesThe catch
Shopify's sort ordersBest selling, alphabetical, price, date created, most relevant or manualNone of them reads a metafield
Manual orderYou drag products into the order of the metafield valueEvery new product and every changed value means dragging again, collection by collection
Theme code (Liquid or JavaScript)Reorders the products shown on one pageOnly sorts what's loaded on that page, breaks across pages, and needs a developer
An app such as Jedi ‑ Collection Sort ProSorts the whole collection by a product metafield through Shopify and keeps it sortedFive metafield types, product metafields only; free for 10 collections

How to sort a collection by a metafield with Jedi

  1. Make sure the field is a product metafield with a definition. In your Shopify admin, go to Settings, open Metafields and metaobjects (called Custom data in older admins), choose Products and add a definition of type Integer, Decimal, Date, Date and time or Single line text, with one value. Then fill it in on your products, one at a time or with Shopify's bulk editor.
  2. Install Jedi ‑ Collection Sort Pro and open Sorting strategies. Click Create strategy, or edit the Default strategy the app created when you installed it.
  3. In Sorting layers, find the layer that should follow the metafield. Usually that's Other products, which holds every product no other layer takes. Under its Sort order, open the list of sort types and choose Product Metafield.
  4. In Configure Metafield Sort Order, pick your field under Select definition (Products), choose High to Low or Low to High under Order and click Done. High to Low puts the largest number or the latest date first.
  5. Under Sorting frequency, choose Scheduled (for example once a day) or Trigger on product update, then click Save.
  6. Open Sort collections, select your collections, click Set strategy, choose the strategy under Sorting strategy and click Set Strategy. Then click Set sorting active and confirm with Set as active. Use Sort now whenever you want an immediate re-sort, for example after a bulk edit.

From then on the app keeps each collection in metafield order. New products take their place at the next sort, and a product whose value changes moves with it.

Good to know before you start

  • Five types, product metafields only. You can sort by an Integer, Decimal, Date, Date and time or Single line text metafield with one value. List fields, variant metafields and types stored as structured data, such as rating, money or weight, aren't offered.
  • Products without a value. With a number or date field, they go to the end of the layer in both orders. With a text field, Low to High (A to Z) puts them first and High to Low (Z to A) puts them last.
  • Text sorts as text. In a Single line text field, "10" comes before "9". Keep numbers such as a rank in an Integer or Decimal field.
  • Sold-out products still go down. The Out of stock products layer always takes sold-out products, wherever it sits in the list, so a sold-out product with a high value doesn't stay on top. See how to push down sold-out products.
  • Changes show at the next sort. A new or edited value moves a product the next time the collection is sorted: at the next scheduled run, or when you click Sort now.
  • The app takes over the collection's order. Activating sorting switches the collection to a manual order. If someone picks another sort order on the collection's page in your Shopify admin, the app turns sorting off for that collection, and you turn it back on in Sort collections.
  • Shoppers can still choose another order. The app sets the order shoppers see by default, usually labeled Featured in your store's sort menu. A shopper who picks "Price, low to high" sees Shopify's price order instead.

Tips for sorting by a metafield

  • Use a date for launches. A release date field puts new products first on the day they go live, even when you created them weeks earlier.
  • Use a number for a hand-picked order at scale. Rank products with a priority field in Shopify's bulk editor instead of dragging them. Products you leave empty go after the ranked ones.
  • Break ties. When many products share a value, such as a season, Nested sort sorts by the metafield first and then by a second field, such as price or vendor.
  • Group, then sort. A Custom - group by attributes/metafields layer pulls the products that match a condition, for example a "drop" field set to "Holiday", into a layer of their own, and every layer has its own Sort order.
  • Blend with sales. AI sort (Multi Params) can weigh a number or date metafield together with sales, stock and profit, instead of sorting by the metafield alone.
  • Check before you switch it on. Preview sorting shows a collection's new order without changing your store (for collections of up to 200 products), and the visual merchandiser shows metafield values on every product card.

Frequently asked questions

Can Shopify sort a collection by a metafield on its own?

No. Shopify's sort orders are best selling, alphabetical, price, date created, most relevant and manual, and the sort menu in your theme offers the same fixed choices. Metafields can filter a collection but not order it. To sort by one, drag products into place by hand or use an app such as Jedi ‑ Collection Sort Pro.

Which metafield types can I sort a collection by?

With Jedi ‑ Collection Sort Pro, product metafields with a definition of type Integer, Decimal, Date, Date and time or Single line text, holding one value. List fields, variant metafields and structured types such as rating or money aren't supported.

Where do products without a value go?

With a number or date field, to the end of the layer, whichever order you choose. With a text field, Low to High puts them first and High to Low puts them last. To control where they go, fill in the field for every product or give those products a layer of their own.

Can shoppers pick "sort by metafield" in my store's sort menu?

No. The sort menu is built from Shopify's fixed options. The app sets the order shoppers see by default, and choosing another option in the menu switches to Shopify's order for that visit.

Does sorting by a metafield change my theme or slow down my store?

No. The app reorders the collection through Shopify's API in the background and adds no code to your theme or storefront.

How much does it cost to sort a collection by a metafield?

Jedi ‑ Collection Sort Pro is free for up to 10 collections, with 2 sorting strategies and unlimited sorts. Paid plans start at $2.99 a month for 20 collections and unlimited strategies, with a 7-day free trial.

Sort your collections by the fields you already keep

Jedi sorts any collection by a product metafield and keeps it sorted, free for your first 10 collections with unlimited sorts.

Install Jedi free on Shopify