I am trying hide / unset the 'Downloadable' and 'Virtual' checkbox options from Woocommerce entirely. I have managed to unset them everywhere EXCEPT in the Woocommerce Variations Panel here:

Woocommerce variations checkbox's - Downloadable and Virtual

Looking in the Woocommerce plugin files I can see an action hook called 'woocommerce_variation_options' which seems to spit out the options for these checkboxes. I can obviously do a "dirty" injection of CSS here but whats the correct method to unset these checkboxes?

I am looking for something like this:

add_action( 'woocommerce_variation_options', 'my_customize_variation_fields_func', 10, 3 );
function my_customize_variation_fields_func( $loop, $variation_data, $variation ){  
// Remove / Unset "Virtual" checkbox
// Remove / Unset "Downloadable" checkbox

I have tried using unset( $variation[ 'virtual' ] ); here but does not work? Any help / advice appreciated :-)

  • You'll need to check with WooCommerce support. Third-party plugins are off topic here.
    – Pat J
    Mar 15 at 18:58
  • 1
    @PatJ Thanks for the heads up! Doh I didn't realise.
    – dekkyd
    Mar 15 at 19:16
  • The hint, often ignored, is in the 'woocommerce off-topic' tag that you used. Just saying for anyone that is lurking.... Mar 16 at 0:00
  • So I assume this has been considered 'off-topic' in more recent times? (As I see many older topics containing woo issues).
    – dekkyd
    Mar 17 at 9:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.