How to Sort Shopify Collections by Profit Margin Instead of Just Volume
Shopify can sort a collection by orders, price, title, or date. It cannot sort by profit. If you want the products that make you the most money in your best slots, you have to build that order yourself or automate it. This guide covers both, starting with the data Shopify already gives you.
Why volume and profit pull in different directions
Shopify’s Best selling sort ranks on the all-time number of orders that include a product. That rewards whatever ends up in the most carts, which is often a cheap accessory or a discounted item, not the product with the healthiest margin. Two products can sell the same number of units while one earns you three times as much per sale.
For the strategy side of this, read Sort Collections for Profit, Not Popularity. Below is the how-to.

Step 1: Add a cost to every product in Shopify
Every margin calculation starts with Shopify’s Cost per item field:
- Open a product in your Shopify admin.
- In the Price section, enter what the product costs you in Cost per item. If the product has variants, enter a cost for each variant.
- Save. Shopify now shows the projected profit and margin on the product page, calculated as (price − cost) ÷ price.
For a large catalog, add costs in bulk: export your products, fill in the Cost per item column of the CSV, and import it back. One catch from Shopify’s docs: if your prices include tax and the product is set to charge tax, the profit and margin are not shown on the product page.
Step 2 (manual): Rank by margin in a spreadsheet
With costs in place, you can build a margin order by hand:
- Go to Products and export the products in the collection to CSV.
- In a spreadsheet, add a column for margin: (Variant Price − Cost per item) ÷ Variant Price.
- Sort by margin, highest first. Remove anything that is sold out.
- Open the collection under Products → Collections, set the sort to Manually, and use Move → To position to place your top products in the first rows.
It works, but it is a snapshot. Prices change, discounts change the real margin, products sell out, and the order goes stale. You also have to redo it for every collection.
Don’t sort by margin alone
There is a bigger problem with a pure margin sort: your highest-margin products are not always the ones shoppers want. Put ten slow movers in the top rows and margin per sale goes up while total profit goes down, because fewer people buy anything.
The order that works blends signals:
- Margin decides which products deserve a boost.
- Recent sales confirm shoppers actually want them.
- Stock keeps sold-out and broken-size products out of the top rows.
- Click-through rate demotes a high-margin product that shoppers keep scrolling past.
That is close to impossible to maintain in a spreadsheet, and it is exactly what automation is for.
The automated way: SortWise
SortWise uses the cost per item you already keep in Shopify. Profit-margin sorting is included on every plan, including free:
- Install SortWise from the Shopify App Store.
- Choose a collection and build a strategy that ranks on profit margin, blended with recent sales from the last 7, 14, or 30 days.
- Turn on push down out of stock so sold-out products never hold a top slot.
- Enable automated sorting. The collection re-sorts every hour.
Prefer to describe it? The AI Strategy Generator turns “boost high-margin products that are selling this month and in stock” into readable rules you can edit. Learn more about profit sorting.
Prove that margin-first beats volume-first
Margin-first is a hypothesis until shoppers vote on it. The SortWise Strategy Lab runs your volume-first order and your margin-first order side by side on live traffic, then shows which one earned more. A/B testing starts at $9/month.
Watch two numbers while it runs: revenue per view, which tells you how much each collection visit earns, and click-through rate by position, which tells you whether shoppers still click the products in your top slots.
The short version
- Shopify cannot sort a collection by profit, but it stores the cost data you need.
- Add Cost per item to every variant, then rank by margin in a spreadsheet if you want a one-off order.
- Blend margin with recent sales and stock instead of sorting by margin alone.
- Automate it hourly, and A/B test it against your current order.
Install SortWise free on the Shopify App Store and put your most profitable products where shoppers look first.
Keep reading
All articles
Why the Top 3 Rows of a Shopify Collection Make the Sale
Learn how product position, availability, demand, profit, and testing work together to build better Shopify collection pages. Read article
Strategy for Advanced Collection Merchandising
Learn how collection sorting, inventory signals, and measurable merchandising decisions can turn a Shopify product grid into a more useful shopping path. Read article