Woocommerce category show subcategories only/omit posts for specific category

I have a woocommerce shop with 2000+ products. I have set the shop catalog to show subcategories AND products. However, there are some categories that are so vague that there is no need to show any products until customer narrows filter.

I would therefore like to omit products from said pages to help with page load speed and customer confusion.

Something like.
If category id = 123
echo

.subcategories-div {display:block}
.products-div {display:none}

But then obviously, not do it via css.

Thanks

Read more here:: Woocommerce category show subcategories only/omit posts for specific category

Leave a Reply

Your email address will not be published. Required fields are marked *