# Phone Number Field for the Shipping Address

> Adds a phone field to the classic checkout's shipping address, so couriers can reach the recipient when an order is sent to someone else.

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

## Code

```php
$wpide_shipping_phone_required = false; // Make the recipient phone required.

add_filter( 'woocommerce_shipping_fields', function ( $fields ) use ( $wpide_shipping_phone_required ) {
    if ( ! isset( $fields['shipping_phone'] ) ) {
        $fields['shipping_phone'] = array(
            'label'        => 'Recipient phone',
            'type'         => 'tel',
            'required'     => $wpide_shipping_phone_required,
            'class'        => array( 'form-row-wide' ),
            'validate'     => array( 'phone' ),
            'autocomplete' => 'shipping tel',
            'priority'     => 95,
        );
    }

    return $fields;
} );
```

## Notes

Uses WooCommerce's own shipping_phone order field, so it appears on the order screen and in exports automatically.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Phone Number Field for the Shipping Address" 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/
