# Change Checkout Field Labels and Placeholders

> Renames checkout fields and their placeholder hints, for example "Town / City" to "City" or "Apartment, suite, unit" to "Flat or floor", without a translation plugin.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, checkout, fields, labels
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-checkout-labels-placeholders/

## Code

```php
$wpide_field_texts = array( // Field key => array( label, placeholder ).
    'billing_city'      => array( 'City', '' ),
    'shipping_city'     => array( 'City', '' ),
    'billing_address_2' => array( '', 'Flat, floor or building (optional)' ),
    'billing_phone'     => array( 'Mobile number', 'For delivery updates' ),
    'order_comments'    => array( 'Delivery notes', 'Gate code, safe place, etc.' ),
);

add_filter( 'woocommerce_checkout_fields', function ( $fields ) use ( $wpide_field_texts ) {
    foreach ( $fields as $group => $group_fields ) {
        foreach ( $wpide_field_texts as $key => $texts ) {
            if ( ! isset( $group_fields[ $key ] ) ) {
                continue;
            }

            if ( '' !== $texts[0] ) {
                $fields[ $group ][ $key ]['label'] = $texts[0];
            }

            if ( '' !== $texts[1] ) {
                $fields[ $group ][ $key ]['placeholder'] = $texts[1];
            }
        }
    }

    return $fields;
}, 20 );
```

## Notes

Use full field keys such as billing_city or order_comments, and leave a value empty to keep WooCommerce's default.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Change Checkout Field Labels and Placeholders" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
