How to hide the SKU in WooCommerce

woo cart

The SKU or reference number is an optional element in WooCommerce products, usually used to put IBAN codes or similar, that if you do not want to show it can be easily removed.

Hide SKU in WooCommerce completely

To hide the SKU in WooCommerce from everywhere, even in the editor, in the product data, just add the following code to your customizations plugin or to the functions.php file of your child theme.

/** Don't show SKU **/
add_filter( 'wc_product_sku_enabled', '__return_false' );Code language: PHP (php)

Or, if you prefer, there is a plugin that does exactly the same thing: WooCommerce Remove SKU.

Hide SKU in WooCommerce only on product page.

Now, if you want to keep using the SKU for your internal issues but don’t want it to be displayed on the product page then the code is this other one:

/* Don't show SKU in product pages */
function aw_remove_product_page_sku( $enabled ) {
    if ( ! is_admin() && is_product() ) {
        return false;
    }
    return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'aw_remove_product_page_sku' );Code language: PHP (php)

And another variation of using this filter, if you prefer, would be this:

/* Remove SKU WooCommerce from store */
add_action('woocommerce_before_single_product_summary', function() {
    add_filter('wc_product_sku_enabled', '__return_false');
});Code language: JavaScript (javascript)

And another way to do it would be to hide its display using CSS, like this:

//Hide SKU
.sku_wrapper {
display:none;
}Code language: JavaScript (javascript)

Read this post in Spanish: Cómo ocultar el SKU en WooCommerce

How useful was this post?

Click on a smiley to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

About The Author

1 thought on “How to hide the SKU in WooCommerce”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top