Shopify has no built-in sort order that pushes sold-out products to the bottom of a collection. Your realistic options are to hide sold-out items completely (with a smart collection rule or a theme filter) or to use an app that re-sorts the collection automatically, keeping out-of-stock products visible but demoted below everything shoppers can actually buy.
Why Doesn’t Shopify Do This Natively?
Every built-in sort order (best selling, price, newest, alphabetical, manual) ignores inventory. Best selling is the worst offender: your strongest products are exactly the ones that sell out, so the first row of a busy collection fills up with items nobody can purchase. Manual sorting freezes whatever order you set, so a product that sells out an hour after you arranged the page stays right where you left it until someone notices.
Should You Hide or Demote Sold-Out Products?
You can remove sold-out items entirely with a smart collection rule such as inventory stock greater than zero. That keeps pages clean, but it has costs: shoppers cannot find products to request restock alerts, thin collections look thinner, and the product page loses its collection entry point. Demoting is usually the better trade. The product stays in the collection and stays discoverable, it just stops occupying premium positions that should be selling for you.
How Does Inventory-Aware Sorting Work?
An app working through Shopify’s APIs reads inventory on a schedule, computes your preferred order for in-stock products, then moves sold-out items below them. No theme changes, no storefront scripts. A good setup also supports an inventory buffer, treating nearly-gone products as effectively sold out so a popular item with two units left does not headline the page; we explain the idea in our post on the out-of-stock inventory buffer. Because the order refreshes on a schedule, a restock brings products back up automatically, with nobody touching the admin.
Dynasort handles this out of the box. Install it from the Shopify App Store or see how it works.