Hide SKUs on the Front End
Stops SKUs from being shown on product pages while keeping them available in the admin.
Opens WPIDE on
Code
add_filter( 'wc_product_sku_enabled', function ( $enabled ) {
return is_admin() ? $enabled : false;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.