Hide a Product Variation that is Out of Stock
If you get a request where the customer would like to hide the product variations that are currently out of stock from the drop down, please follow these steps:
First you will need to go to WooCommerce Settings > Products > Inventory > and Check the box to “Hide out of stock items from the catalog” > Save Changes
Then you will need to go to the product variations and click on the “Manage Stock” checkbox for each variation. For each one that is out of stock, set the “Stock quantity” to 0. The variation will no longer show in the dropdown on the product page as long as the quantity is set to 0.