If you don’t want to display the SKU (Stock Keeping Unit) on WooCommerce product pages, you can remove it with a simple filter.
Steps
- Add the code below to your theme’s
functions.php. - Save the changes.
- Open a single product page to verify the SKU is hidden.
/**
* Hide WooCommerce product SKU
*/
function custom_hide_product_sku( $sku, $product ) {
return '';
}
add_filter( 'woocommerce_product_get_sku', 'custom_hide_product_sku', 10, 2 );
