• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

WordPress Tips and Tricks

  • Home
  • WordPress Tutorials
  • Useful Links

Remove Product Types Options in WooCommerce

Home - WooCommerce - Remove Product Types Options in WooCommerce

October 3, 2020 by wptricks

I needed to remove several of the options from the product type dropdown in WooCommerce. This may not be the correct way to do it but it does hide them.

From This:

To This:

Code:

add_filter( 'product_type_selector', function( $types ) {

if( isset( $types['external'] ) ){
unset($types['external']);
}
if( isset( $types['variable'] ) ){
unset($types['variable']);
}
if( isset( $types['grouped'] ) ){
unset($types['grouped']);
}
if( isset( $types['simple'] ) ){
unset($types['simple']);
}

return $types;
} );
Category: WooCommerce, Code Snippets
Previous Post:Remove Virtual & Downloadable From WooCommerce Admin
Next Post:ColorSpace Palette Generator

Sidebar

Recent Posts

  • Truncate Text with CSS
  • CSS { In Real Life }
  • Prevent Links in Gravity Forms Paragraph Text Field
  • Meta Description on Pages
  • Find Out Which Host a Website is On

Categories

  • Code Snippets
  • Design Resources
  • Fonts
  • SEO
  • Tutorials
  • Uncategorized
  • Useful Links
  • WooCommerce

A Few of Our Favorite Products


Copyright © 2023 · WordPress Tips and Tricks · All Rights Reserved

Back to top