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
    1. Online Store › Themes › … on your theme › Duplicate.
    2. Make the change on the copy, preview it, and publish only when it works.

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

  • The theme editor (to add a Custom Liquid block; no code editing)

    How to get this: The theme editor
    1. Online Store › Themes › Edit theme (on a copy of your theme if you want to test first).
    2. Add section or Add block › Custom Liquid, paste the code, then Save.

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

  • Shopify’s free GraphiQL app (with read_products, write_products (for the collections step) 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)

Or hide sold-out products for good

Steps

  1. Apps › Search & Discovery › Filters › Add filter › Availability, then Save.
  2. 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.
  3. 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.

More guides