Shopify sold out guide
Show only in-stock products by default on Shopify
What you’ll need
A duplicate of your theme to test on
How to get this: A duplicate of your theme to test on
- Online Store › Themes › … on your theme › Duplicate.
- Make the change on the copy, preview it, and publish only when it works.
The theme editor (to add a Custom Liquid block; no code editing)
How to get this: The theme editor
- Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
- Add section or Add block › Custom Liquid, paste the code, then Save.
Shopify’s free GraphiQL app (with read_products, write_products (for the collections step) access)
How to get this: Shopify’s free GraphiQL app
- Install it once from shopify-graphiql-app.shopifycloud.com: enter your store address, tick the access listed here, click Install and approve.
- Then open it any time from Apps › Shopify GraphiQL App in your admin.
Or hide sold-out products for good
Steps
- Apps › Search & Discovery › Filters › Add filter › Availability, then Save.
- Content › Menus › your main menu: edit a collection link and paste its address with ?filter.v.availability=1 at the end, for example /collections/tees?filter.v.availability=1.
- Save the menu and click the link on your store: the In stock filter is already ticked.
When to hide instead
If you never want sold-out products in a collection, the inventory condition removes them for everyone, not just visitors who use your menu.