WooCommerce Phone Number Format: How to Validate and Standardise Numbers at Checkout
The WooCommerce phone number format is looser than most store owners expect. Out of the box, WooCommerce accepts almost any mix of digits, spaces and punctuation in the phone field and saves it exactly as the customer typed it. That is fine for a courier who reads the number off a label, but it causes problems for SMS order notifications, POS and CRM matching, and duplicate customer checks. This guide explains what WooCommerce accepts by default, what changed in WooCommerce 11.0, how Australian numbers should be written, and how to validate and standardise numbers with a few lines of code.
In this guide

What WooCommerce accepts by default
WooCommerce checks the phone field in three places: the classic checkout, the block checkout (through the Store API) and the address forms in My Account. All three call the same function, WC_Validation::is_phone().
The default WooCommerce phone number format check is a character check, not a format check. A number passes if it only contains:
- Digits 0 to 9
- Spaces
- The characters
+ - ( ) . / # _
Anything else, such as letters, fails with the message “Billing Phone is not a valid phone number.” But there is no check on length, country or structure. In practice this means:
0491 570 159,+61 491 570 159and(04) 9157-0159all pass.123,0000and4915also pass, even though none of them can be called or texted.0491 57O 159(with a capital letter O instead of a zero) fails.
WooCommerce also saves the number as typed. It removes invisible characters that sometimes come with copy and paste, but it does not strip spaces or convert the number to one standard format. So your orders table ends up with the same mobile number stored several different ways.
The new phone hooks in WooCommerce 11.0
Before version 11.0, changing WooCommerce phone validation meant hooking into each checkout separately. The WooCommerce 11.0 developer notes added two focused hooks and one helper method:
woocommerce_validate_phonefilters whether a number is valid. It receives the default result, the phone number and the country code of the address (or null if the country is unknown). Becauseis_phone()runs in the classic checkout, the block checkout and My Account, one filter covers all three.woocommerce_format_phone_numberfilters the output ofwc_format_phone_number(). It receives the formatted number, the original input and whether the original passed the default check. In the WooCommerce 11.2 code we checked, core does not run checkout input through this function, so it does not change what is saved. It is a presentation hook for extensions and themes that call the function.WC_Validation::is_phone_format()runs the original character check without the filter, so you can still get the default answer from inside your own validation.
If your store is still on an older version, the filter is not available. Updating is worth doing anyway, and our post on what to test before updating to WooCommerce 11.3 covers the process.
Australian phone number formats
Australian numbers are set by the ACMA numbering rules. The Australian Government Style Manual sets out how to write them. The main types a store will see at checkout are:
| Type | Starts with | Digits | National format | International format |
|---|---|---|---|---|
| Mobile | 04 | 10 | 0491 570 159 | +61 491 570 159 |
| Landline | 02, 03, 07, 08 | 10 | 02 5550 4321 | +61 2 5550 4321 |
| Local rate | 1300 | 10 | 1300 975 707 | Not used |
| Local rate (short) | 13 | 6 | 13 00 00 | Not used |
| Freephone | 1800 | 10 | 1800 160 401 | Not used |
If most of your customers are in Australia, these are the formats your WooCommerce phone number format rules should accept. The rule for the international format is simple: add +61 and drop the leading 0. The 05 range is set aside for mobiles once the 04 range runs out, and since March 2026 new IoT devices use 09 numbers instead of 04. Neither should normally appear on a customer checkout today.
Why the format matters for SMS and integrations
An inconsistent WooCommerce phone number format is usually invisible until something downstream tries to use it. The common cases are:
- SMS notifications. SMS gateways expect the E.164 format: a plus sign, the country code and the number, with no spaces and no more than 15 digits. For an Australian mobile that is
+61491570159. Landlines, 13, 1300 and 1800 numbers cannot receive a text. - POS, ERP and CRM matching. When a store syncs customers to a POS or CRM, the phone number is often one of the fields used to find an existing record.
0491 570 159and+61491570159do not match as plain text, so duplicates get created. - Duplicate account checks. If you block repeat registrations by phone number, as in our unique phone number snippet, the comparison only works when numbers are stored the same way.
- Fake and typo numbers. A number like
123passes the default check. Couriers and click and collect staff then have no way to reach the customer.
EUX builds and supports SMS notification plugins for WooCommerce, including our own WooCommerce SMS Notification plugin, so number formatting is one of the first things we check on an SMS project. Our WooCommerce SMS order notifications guide covers the rest of that setup.
Try it: Australian phone number checker
Type a number the way a customer might, or pick an example, to see how the WooCommerce phone number format rules treat it. The checker shows whether default WooCommerce would accept it, what type of number it is, and the national and E.164 versions.
Default WooCommerce check
Number type
National format
E.164 (for SMS and integrations)
How to validate and standardise numbers in code
The snippets below need WooCommerce 11.0 or later. Add them to a small custom plugin or a code snippets plugin, not to a parent theme’s functions.php, and test on staging first.
Step 1: A helper that converts Australian numbers to E.164
This function strips everything except digits and the plus sign using the core wc_sanitize_phone_number() helper, then converts the common Australian input styles to E.164. It returns an empty string if the result is not a valid Australian mobile or landline.
function eux_au_phone_to_e164( $phone ) {
$digits = wc_sanitize_phone_number( $phone );
if ( 0 === strpos( $digits, '+61' ) ) {
$digits = '0' . substr( $digits, 3 );
} elseif ( 0 === strpos( $digits, '0061' ) ) {
$digits = '0' . substr( $digits, 4 );
} elseif ( 0 === strpos( $digits, '61' ) && strlen( $digits ) === 11 ) {
$digits = '0' . substr( $digits, 2 );
} elseif ( 0 === strpos( $digits, '4' ) && strlen( $digits ) === 9 ) {
$digits = '0' . $digits;
}
// Mobile (04) or landline (02, 03, 07, 08), 10 digits in total.
if ( preg_match( '/^0[23478][0-9]{8}$/', $digits ) ) {
return '+61' . substr( $digits, 1 );
}
return '';
}
Step 2: Validate the WooCommerce phone number format for Australian addresses
This filter applies stricter WooCommerce phone validation only when the address country is Australia, so overseas customers are still checked with the default rule. Because it uses woocommerce_validate_phone, it runs in the classic checkout, the block checkout and My Account.
add_filter( 'woocommerce_validate_phone', function ( $valid, $phone, $country ) {
if ( ! $valid || 'AU' !== $country ) {
return $valid;
}
return '' !== eux_au_phone_to_e164( $phone );
}, 10, 3 );
If you only want to accept mobiles, for example because every order gets an SMS, change the pattern in step 1 to /^04[0-9]{8}$/. Also update the field label or description so customers know a mobile is required.
Step 3: Save a standard copy on the order
We recommend keeping the number the customer typed in the billing phone field and saving the standard version separately. Customers then see their own number in emails and My Account, and your SMS and integration code reads a clean value. The classic and block checkouts fire different actions, so hook both:
function eux_save_phone_e164( $order ) {
if ( 'AU' !== $order->get_billing_country() ) {
return;
}
$e164 = eux_au_phone_to_e164( $order->get_billing_phone() );
if ( $e164 ) {
$order->update_meta_data( '_billing_phone_e164', $e164 );
$order->save();
}
}
// Classic checkout.
add_action( 'woocommerce_checkout_order_processed', function ( $order_id, $posted_data, $order ) {
eux_save_phone_e164( $order );
}, 10, 3 );
// Block checkout.
add_action( 'woocommerce_store_api_checkout_order_processed', 'eux_save_phone_e164' );
Both actions fire before payment is processed, so the value is in place before any order status emails or SMS messages are sent. The code uses order methods rather than post meta, so it works with HPOS.
Step 4: Help customers type it correctly
- Label the field clearly. “Mobile number” gets better input than “Phone” when you plan to send SMS.
- Make it required if you need it. In the block checkout, select the Checkout block in the editor and set the phone field to required. In the classic checkout, the setting is under Appearance, Customize, WooCommerce, Checkout.
- Keep the field type as tel. WooCommerce already uses it, which gives mobile shoppers a number keypad and lets browsers autofill the saved number.
- Avoid strict input masks. A mask that forces
0000 000 000blocks overseas customers and people pasting a number with +61. Accept loose input and standardise it on the server instead.
Plugin or custom code
Both options can enforce a consistent WooCommerce phone number format. The right one depends on where your customers are.
- Mostly Australian customers: the snippets above are usually enough. They are short, have no extra settings screens and are easy to review.
- Many countries: rules for every country are hard to maintain by hand. Plugins listed on WooCommerce.com, such as Phone Number Validation and Phone Validator and Formatter, add a country picker and per-country rules. On the code side, the PHP port of Google’s libphonenumber library is the common choice for developers.
- SMS or POS integration in place: check where the integration reads the phone number before changing anything. Some read the billing phone directly and may already do their own clean up.
Whichever route you choose, test your WooCommerce phone number format rules with a test order for each number style shown in the checker above, using both checkouts if you still run the classic one anywhere.
FAQ
What phone number format does WooCommerce use?
WooCommerce does not enforce one. It accepts digits, spaces and the characters + – ( ) . / # and _, then saves the number as typed. There is no length or country check unless you add one.
How do I validate phone numbers in the WooCommerce block checkout?
On WooCommerce 11.0 or later, use the woocommerce_validate_phone filter. The block checkout validates addresses through the Store API, which calls the same validation function as the classic checkout, so one filter covers both.
Should I store phone numbers in E.164 format?
Store an E.164 copy for SMS and integrations, but keep the number the customer typed in the billing phone field. That gives your systems a clean value without changing what the customer sees.
How do I write an Australian mobile number in international format?
Add +61 and drop the leading 0. The mobile 0491 570 159 becomes +61 491 570 159, or +61491570159 without spaces for SMS systems.
How we can help
EUX is a Sydney WooCommerce agency and one of three WooCommerce Pro Partners in Australia. We set up checkout validation, SMS notifications and POS and ERP integrations for Australian stores, and we can review your WooCommerce phone number format, validation and how customer numbers flow into other systems. See our WooCommerce development services or contact us to talk about your store.
Sources
- WooCommerce 11.0: What’s coming for developers, WooCommerce Developer Blog
- WC_Validation class reference, WooCommerce Code Reference
- Choose your phone number, Australian Communications and Media Authority
- Telephone numbers, Australian Government Style Manual
- What is E.164?, Twilio

WordPress Pro Partner














