Shopify · May 22, 2026
How to automatically push out-of-stock Shopify products to the bottom of your collections
A customer lands on your collection page. The first three products are out of stock. They click one anyway, see “Sold out”, and bounce. You’ve just paid for the click and earned nothing.
The fix is simple in principle and annoying in practice: keep your collection sorted, but always push out-of-stock products to the bottom. Here’s why the obvious solutions fall short, and what actually works.
What Shopify gives you natively
Shopify’s collection sort options are: Best selling, Product title (A-Z, Z-A), Highest price, Lowest price, Newest, Oldest, Manually. None of them have an out-of-stock-aware option.
You have three native workarounds, and none are great.
Hide sold-out products entirely. Settings → Search and Discovery → Filters → “Show out of stock products” off. Problem: the products disappear from collection pages and from search. If a sold-out product is one you restock weekly, you lose all the SEO equity on its product page every time it goes out of stock. Bad trade.
Use the “Best selling” sort. Shopify’s best-selling sort is recency-weighted and based on sales. A product that’s sold a lot historically can stay near the top even after it sells out, which is the exact behavior you’re trying to fix.
Manually reorder the collection. Drag products to the bottom one at a time, every time stock changes. This works for ten products and a static catalog. It does not work for hundreds of SKUs that go in and out of stock weekly.
What you actually want
Three behaviors at once:
- The collection is sorted by something useful (units sold, revenue, newest, whatever fits the collection)
- Any product currently out of stock drops to the bottom of the collection regardless of its sales score
- When the product comes back in stock, it returns to its ranked position automatically, no manual intervention
The reason this doesn’t exist natively is that Shopify treats sort order and inventory state as separate concerns. You need something that recombines them.
The RankRobin approach
RankRobin is a Shopify app that sorts collections by sales performance with a per-rule “out of stock” toggle. When the toggle is on:
- The rule scores every product as normal (units, revenue, trending, whatever metric you chose)
- Before writing the order to Shopify, every out-of-stock product is moved to the end of the ranked list
- The collection updates on schedule (daily or hourly) and on inventory webhooks, so an item going out of stock or back in stock is reflected quickly
You set it up once per template. Apply that template to every collection that should behave the same way. Done.
Setting it up
- Install RankRobin and let the historical sales backfill run
- Open Templates and create a sort rule. Pick a metric (units sold over the last 30 days is a good default for most stores)
- Toggle Push out-of-stock to bottom to on
- Set a cadence: daily is enough for most stores, hourly for high-velocity catalogs
- Open Collections and link your template to the collections you want to apply it to
That’s it. Within minutes the collection reorders and out-of-stock products move to the bottom.
Edge cases worth knowing
Pre-orders and “Continue selling when out of stock”. RankRobin reads Shopify’s inventory state. If a product has the “Continue selling when out of stock” setting on, Shopify reports it as in-stock for our purposes, so it stays in its ranked position. This is usually what you want for pre-order workflows.
Variants partially out of stock. A product is treated as in-stock if at least one variant has inventory. Most stores want this; a few want the opposite. Either is configurable on the rule.
Pinned products. Pinned products always stay at the top, even if out of stock, because you’ve explicitly told Shopify they should. If you want pins to also drop when out of stock, leave them unpinned and rely on the sort metric instead.
Why this matters more than it looks
For a 500-product collection where 8% of products are typically out of stock at any moment, you’re looking at ~40 sold-out products eligible to appear in any first-page view. Most themes show 24-48 products per page. Without an out-of-stock sort, a meaningful chunk of your most-visible inventory is unbuyable. Pushing them down doesn’t hide them; it just stops them from cannibalizing the products that can actually convert.
If you only fix one thing about your collection pages this quarter, this is the highest-ROI single change.