A simple, powerful and independent e-commerce platform.
Sell anything with ease.

Hide SKUs in frontend only, or completely

The first example in this code snippet can be used to remove all references to SKUs entirely from the site, frontend and backend. The second example just hides them on the frontend.

/**
 * Disable SKUs completely
 */

add_filter('wc_product_sku_enabled', '__return_false');


/**
 * Hide SKUs in the frontend but keep them in the backend
 */

add_filter('wc_product_sku_enabled', 'cc_hide_frontend_skus');

function cc_hide_frontend_skus($enabled){

  if(!is_admin() && is_product()){
    return false;
  }

  return $enabled;

}
View Raw Code ID: 1034