Back to Blog

WooCommerce Snippet: Remove the Product SKU from WooCommerce Product Page with 2 simple methods

See how to easily remove the product SKU from the WooCommerce product page.


WooCustomizer: Remove the product SKU

The WooCommerce product SKU is often only used by admin or shop managers in your WooCommerce store, but by default it is shown on the WooCommerce Product page below the Add To Cart button(s). It is often that you might want to remove this from the product page as your customers don’t really need to see it when purchasing from your eCommerce shop.

The Product SKU is often only used by shop managers for tracking the inventory of the store products, so it might not make much sense to display it on the front-end for your shop customers.

There are 2 easy methods you can use to remove the product SKU from the WooCommerce product page:

Remove the Product SKU using PHP

To easily remove the product SKU from the product page in WooCommerce, you can simply add the following code to the functions.php file of your child theme, or instead of creating a child theme, you can simply install this small site customizations plugin which lets you add custom php, CSS or javascript code to your website.

// Remove the Product SKU from Product Single Page
add_filter( 'wc_product_sku_enabled', 'woocustomizer_remove_product_sku' );

function woocustomizer_remove_product_sku( $sku ) {
     // Remove only if NOT admin and is product single page
     if ( ! is_admin() && is_product() ) {
         return false;
     }
     return $sku;
 }

Remove the Product SKU using CSS

As an extra backup, you can also add the following custom CSS to your theme to ensure the WooCommerce product SKU is removed from the product page. This CSS can also be added via the Site Customizations plugin, or you can add it to Customize -> Additional CSS in the WordPress Customizer.

.single-product span.sku_wrapper {
    display: none !important;
}

Are you not comfortable adding your own code because you know it could break?

Then rather use our StoreCustomizer plugin which offers these code snippets and settings for this, all built into the WordPress Customizer to easily remove the product SKU from the WooCommerce product page.