You can control the visibility of multiple shipping methods by using Addify Advanced Conditional Shipping extension. You can set it up in minutes. Once you have activated it, go to WooCommerce > Conditional Shipping > Shipping Methods Visibility and apply the condition on the basis of if Y & Z methods are activated then remove Y and show Z method only. For detailed configuration, follow these steps:
1. Install and activate the extension. Go to WooCommerce > Conditional Shipping and click on Shipping Method Visibility.
2. Here, you need to apply the conditions like Enter any two activated shipping methods and keep only one shipping method to display to customers.
3. It goes like:
- If these methods are available: Flat rates & Free Shipping
- Then Remove all and Keep: Free Shipping Only.
