Goal: Automatically hide empty Shopify collections (and sub-collections) and show them again when products are added.
Primary solution proposed:
Use a Liquid condition around collection output: {% if collection.products_count != 0 %} ... {% endif %}.
For the Simple theme, add this inside the loop in sections/list-collections-template.liquid before the grid__item markup. Same logic can be applied to block-based setups.
Note: collection.products_count reflects how many products are assigned to the collection (not inventory quantity).
Follow-up reports:
One user on Debut (v11.0.1) wrapped their list items with the same condition but still saw empty collections; response suggested verifying that collections are truly empty (products assigned vs inventory only).
Others reported empty collections still appear, especially in sidebar/menu; screenshots were shared but no confirmed fix beyond the main condition.
Another code example reiterated filtering by collection.products_count != 0 when rendering links.
A request for help on a custom Porto theme was made with no specific solution provided.
Status: No universal resolution for themes beyond Simple; main approach is documented, but some users still see empty items (possibly from navigation menus). Discussion remains open.
Working on finishing up the configuration for the new site and need some assistance with a few things. First one is I need to be able to hide empty collections and sub-collections automatically and to have them repopulate as items are added to them.
I’ve tried a couple of processes for other themes that did not work in this one and was not able to find one that was done for the simple theme.
You can hide the empty collections using the condition below.
{% if collection.products_count != 0 %}
...
{% endif%}
Take https://juststuffisell.com/collections as an example . The code is in sections/list-collections-template.liquid in Simple theme. I have added this condition inside the loop before the grid__item . You can use the same logic if you are using blocks too.
I was so happy to find your solution here and I tried immediately, but unfortunately it doesn’t work on my side. I have the Theme DEBUT (VERSION 11.0.1) installed. Could that be the reason? My code looks a little bit different, but not so much…
{% for collection in collections %}
<li class="grid__item {{ grid_item_width }}">
{% include 'collection-grid-item', collection_image_size: image_size %}
</li>
{% endfor %}
this code I changed to…
{% for collection in collections %}
{% if collection.products_count != 0 %}
<li class="grid__item {{ grid_item_width }}">
{% include 'collection-grid-item', collection_image_size: image_size %}
</li>
{% endif %}
{% endfor %}
I would be very grateful if you could take a look at it. Thank you in advance
The collections are empty. I have a lot of empty collection right now, because I have not finished assigning the products. There is inventory available, but it’s not linked / allocated to the collection.
I may have missed something in this process. I edited my theme, went to the file that was listed in the example, and added the code:
{% if collection.products_count != 0 %}
Where it was suggested to add the code. I saved the file, refreshed and when i previewed my site, the empty menu items (collections) were still visible.
Is there something I am missing here? Please advise,