I tried it before but it won’t work and I think it’s because I have more than 1 product option, thus i tried link product options in menu which is also not working on my end
I understand your issue where you want to hide variants from your store that are out of stock so it will not create a bad user experience for customers.
I recently came across an app, AutoHide Soldout Products which worked for me to hide out of stock products & variants like size, colour & material. Once products are back in stock, it will be unhidden from the store automatically.