Shopify collection order guide

How to reorder products in a Shopify collection in bulk

What you’ll need

  • Shopify’s free GraphiQL app (with read_products, write_products access)

    How to get this: Shopify’s free GraphiQL app
    1. Install it once from shopify-graphiql-app.shopifycloud.com: enter your store address, tick the access listed here, click Install and approve.
    2. Then open it any time from Apps › Shopify GraphiQL App in your admin.

    Step-by-step guide (opens in a new tab)

Move sold-out products in bulk

How collectionReorderProducts works

  • Each move is a product ID and a new position. Positions start at 0, and Shopify wants them as text: newPosition: "7".
  • Moves run in the order you list them, so moving several products to the last position keeps them in that order.
  • Up to 250 moves per call. With more, Shopify answers “You can reorder up to 250 products at a time. Select fewer products and try again.”
  • It returns a job. The order changes a few seconds later; ask for job { done } to check.
  • The collection must be sorted manually, or Shopify answers “Can’t reorder products unless collection is manually sorted”.

Steps

  1. Install Shopify’s GraphiQL app with read_products and write_products.
  2. Read the collection’s current order (sortKey: COLLECTION_DEFAULT) and keep it: that’s your undo.
  3. Switch the collection to manual sorting if it isn’t (collectionUpdate with sortOrder: MANUAL).
  4. Run the moves, 250 per call, waiting for each job to finish before the next.

Keeping the rest in order

collectionReorderProducts applies moves in the order given, so sending each sold-out product to the last position, one after another, puts them at the end in their original order while every other product keeps its place. It works on manual and automated collections, as long as the collection’s sort is Manually. Shopify keeps no history of a collection’s order, so the only undo is the original order, saved before the move and sent back as moves to positions 0, 1, 2 and so on.

More guides