woocommerce_checkout_fields

The woocommerce_checkout_fields filter changes field definitions in WooCommerce's classic shortcode checkout. It receives a nested $fields array and must return that array. Groups commonly include billing, shipping, and order; each field has an internal key and settings such as label and placeholder.

Change the order-notes placeholder

add_filter( 'woocommerce_checkout_fields', function ( $fields ) {
    if ( isset( $fields['order']['order_comments'] ) ) {
        $fields['order']['order_comments']['placeholder'] = 'Delivery notes (optional)';
    }

    return $fields;
} );

The example changes only the hint text for the order-notes field. The order group and order_comments field key remain unchanged; label would control the visible field label instead. The existence check avoids assuming that order notes are enabled on every store. Add the callback through a site-specific plugin or child theme's functions.php, and review the classic checkout on a staging site.

Classic checkout versus Checkout block

Billing and shipping fields can depend on country-specific address requirements, validation rules, shipping methods, and payment integrations. Altering or removing them has consequences beyond their appearance, so preserve unrelated entries when changing a single setting. The official WooCommerce checkout-field guide explains the classic filter approach.

The Checkout block does not use all the classic field customizations. This example is not a general way to edit block checkout fields. For new fields in the block checkout, use WooCommerce's Additional Checkout Fields API instead.