Is it possible to hide sold products from a manual collection?

Sold products are hidden in all collections that have a Product Condition of “Inventory Stock is Greater Than 0”, but the sold products still show in the manual collections. Is there a way to hide the sold products for the manual collections? TIA

Hi joanyeb! Yes, that behavior is normal because manual collections don’t follow conditions — they display any product you add to them, even if the inventory is 0.

To hide sold-out products inside manual collections, you have 2 options:

Option 1: Use automation instead of manual collections
Convert the manual collection into an automated one and set the condition to:
Inventory stock > 0
This way, any product that becomes sold-out will automatically disappear.

Option 2: Manually remove sold-out products
If you must keep the collection manual, you’ll need to manually remove the products each time they go out of stock. Shopify currently doesn’t support automatically hiding sold-out items in manual collections.

If you want, I can guide you on restructuring your collections so everything hides automatically.

This should be a pretty quick code change in whatever section is rendering your collection template. Something like this:

{% for product in collection.products %}
  {{- product.title | link_to: product.url }}
{% endfor %}

Change to:

{% for product in collection.products %}
  {% if product.available %}
    {{- product.title | link_to: product.url }}
  {% endif %}
{% endfor %}

Filtering products in liquid is not the best option as it will lead to showing, say 4 products on one collection page instead of 12 default and then 12 on the next page.

I believe this is where you can effectively use Flow.
The simplest flow is like:

Obviously you can make it more complex, like looping over product collections and removing from each instead of selecting collections manually; remembering collections in the metafield before removing product from them (and restoring if it back in stock), etc…

Thank you for the information!

It sounds like restructuring the collections would be the best option.

I do have a question about the response from tim_1 of “Filtering products in liquid is not the best option as it will lead to showing, say 4 products on one collection page instead of 12 default and then 12 on the next page.” I was wondering why this would happen?

Also, I am not familiar with Flow. Could you expand on this explanation, please?

Pagination, how many products show per page, is done in groups (12,25,50 etc).
So if your omitting products your leaving holes in each group for each page in the pagination.
Skipping products with {% continue %} instead of just ommiting them has it’s own set of issues.

Shopify flow is an app made by shopify, it’s free to use to build automations either by yourself or with a paid developer.

Paul has already answered, but just wanted to elaborate more.

For larger collections, Liquid can never see all products. It sees a limited set, like a sliding window called pagination. Any Liquid processing is done inside this window.

So the code initially is set to paginate by, say, 24 and show 24 products on page 1, 24 products on page 2, etc.

If you filtering out sold items with Liquid you may easily end up with 10 products shown on page 1, 15 products on page 2, etc…

In extreme case – no products on page 1 and something on page 2.

Thank you very much for the explanations!