How to hide attributes for sold out products in filter area without hiding the sold out products in woocommerce

I’m using woocommerce for my e-commerce website. I need to keep sold out products visible for my clients but I want to hide attributes of sold out products in filtering area. for example if all products of an attribute is out of stock, I don’t want the users to see and select the attribute while filtering the products.
This is my shop page address: www.dyadartisans.com/shop

I tried some plugins but I prefer a snippet