Skip to content

Instantly share code, notes, and snippets.

@tanmay27vats
Last active April 18, 2024 08:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tanmay27vats/89f9d67db78c33a6ffa1d844235a5db1 to your computer and use it in GitHub Desktop.
Save tanmay27vats/89f9d67db78c33a6ffa1d844235a5db1 to your computer and use it in GitHub Desktop.
Remove "Product Type/Product Data" Dropdown Options - WooCommerce
add_filter( 'product_type_selector', 'remove_product_types' );
function remove_product_types( $types ){
unset( $types['grouped'] );
unset( $types['external'] );
unset( $types['variable'] );
return $types;
}
@rebornishard
Copy link

not working sir

@BaskSerg
Copy link

The snippet is working woocommerce 3.4.4

@davidnash
Copy link

Works on WooCommerce 3.4.5 too - thanks!

@stykoss
Copy link

stykoss commented Nov 21, 2018

Works on WooCommerce 3.5.1
Thanks !

@FurkanUcar010
Copy link

Works on WooCommerce 3.8.1.

@Akaaal
Copy link

Akaaal commented Feb 28, 2020

Still working on Woocommerce 3.9.2 BUT comes with a "*Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_product_types' not found or invalid function name in /wp-includes/class-wp-hook.php on line 288"

@artneo7
Copy link

artneo7 commented Sep 25, 2020

Looking exactly for this filter! Thanks!

@rhylkiio
Copy link

rhylkiio commented Feb 2, 2024

Hi, I used the code snippets plugin to do this but it did not work on my side. Could you please help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment