Remove SKU on Woocommerce

Another problem that i was currently working on a WooCommerce site was to remove the SKU code from the actual product display.

To do this i have used the filter from WooCommerce wp_product_sku_enabled.

The function bellow will disable the SKU for products on other pages that are not in the admin.

function remove_product_sku( $enabled ) {
    if ( ! is_admin() && is_product() ) {
        return false;
    }

    return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'remove_product_page_sku' );

Leave a Reply

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