DEV Community

Chris Texe
Chris Texe

Posted on • Originally published at madlon.eu

How to remove SKU in WooCommerce

When you set up a new WooCommerce installation you will see SKU field in your store. I will show you how to remove SKU from WooCommerce without any plugin.

What is SKU

SKU means Stock Keeping Unit. It is a unique ID you can assign to a product for inventory purposes. It's very useful when you use bar codes, you have big inventory and many products. Many products require good inventory management.

But in may cases - especially in small shops - SKU is not used and "SKU: N/A" is a unnecessary information.

Remove SKU in WooCommerce

How to remove SKU in WooCommerce without plugin?

First we need to open functions.php file which is inside our theme directory. Remember that usually you should use child theme. Next put these lines into functions.php file:

// remove SKU
function ct_remove_product_sku($enabled) {
  if (! is_admin() && is_product()) {
      return false;
  }
  return $enabled;
}

add_filter( 'wc_product_sku_enabled', 'ct_remove_product_sku' );
Enter fullscreen mode Exit fullscreen mode

Next save the file and refresh the page. SKU has gone!

Remove SKU in WooCommerce without plugin

If you want more tips follow me on Twitter or visit my blog:

Top comments (0)