Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active February 4, 2019 23:17
Show Gist options
  • Save bekarice/a5cc3ea7ee7ec329629d to your computer and use it in GitHub Desktop.
Save bekarice/a5cc3ea7ee7ec329629d to your computer and use it in GitHub Desktop.
Remove SKUs from WooCommerce product page display
// Remove SKUs from frontend product pages for admin-only use
function skyverge_unhook_product_page_skus( $enabled ) {
// Only remove SKUs if we're not in the admin & on a product page
if ( ! is_admin() && is_product() ) {
return false;
}
return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'skyverge_unhook_product_page_skus' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment