Shopify sold out guide

Hide sold-out products from Shopify search results

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)

Hide them from collections too

Steps

  1. Install Search & Discovery from the Shopify App Store (free, made by Shopify).
  2. Open Apps › Search & Discovery › Settings.
  3. Under Out of stock products choose Hide, Show last or Show, then Save.

Good to know

  • A product counts as out of stock only when all its variants are unavailable.
  • If your theme or a search app sends its own settings, it can override this one.
  • Collections ignore this setting; use the inventory condition for them.

More guides