function jk_add_custom_sku() { $args = array( 'label' => __( 'TC SKU', 'woocommerce' ), 'placeholder' => __( 'TC SKU', 'woocommerce' ), 'id' => 'tcsku', 'desc_tip' => true, 'description' => __( 'This SKU is for internal use only.', 'woocommerce' ), ); woocommerce_wp_text_input( $args ); } add_action( 'woocommerce_product_options_sku', 'jk_add_custom_sku' ); function jk_save_custom_sku( $post_id ) { // grab the custom SKU from $_POST $custom_sku = isset( $_POST[ 'tcsku' ] ) ? sanitize_text_field( $_POST[ 'tcsku' ] ) : ''; // grab the product $product = wc_get_product( $post_id ); // save the custom SKU using WooCommerce built-in functions $product->update_meta_data( 'tcsku', $custom_sku ); $product->save(); } add_action( 'woocommerce_process_product_meta', 'jk_save_custom_sku' );