• Pricing
  • Features
  • Get started
  • Support
  • Docs
  • Account
  • Blog
  • Updates

CheckoutWC

  • Pricing
  • Features
  • Get started

WooCommerce checkout validation: how to validate fields

December 5, 2024 by Ian Misner in WooCommerce Checkout, WooCommerce Tips
(Updated: November 16, 2026)

Table of Contents

  • What WooCommerce validates by default
  • Validate addresses and pair them with autocomplete
  • Validate phone numbers and email addresses
  • Change error messages and add your own rules
  • Don't over-validate
  • Get validation that works from the start

To validate WooCommerce checkout fields, start with what WooCommerce already checks, then add the checks it lacks. WooCommerce confirms required fields are filled and that an email looks like an email. Real address verification, country-aware phone numbers, email domain checks, and your own rules need a plugin or code. Run them inline, as the customer types, with short messages, and stop before the rules cause abandoned orders.

Good validation catches a wrong shipping address before it costs you a reshipment, and it stops failed orders caused by mistyped details. Here’s how to set it up, in the order most stores need it.

What WooCommerce validates by default

Out of the box, WooCommerce checks that required fields are filled in, that the email address is formatted like one, and that the state matches the country. It also checks postcode format for many countries. It doesn’t confirm that a street address exists, it gives little real-time feedback, and it has no settings screen for your own rules. VAT numbers, custom ID formats, and phone numbers by country all need extra work.

CheckoutWC checks fields as customers fill them in and shows a message under any field that needs fixing, so mistakes are caught before the customer clicks to pay. Its built-in checks cover:

  • required fields;
  • email format, plus a check that the email domain can receive mail (it catches typos such as “gmail.con”);
  • postcodes for the selected country, with US ZIP+4 codes accepted with or without the hyphen;
  • names that are email addresses;
  • phone numbers, when the international phone field is on and the phone is required.

The full list of messages is in the custom error messages documentation.

Validate addresses and pair them with autocomplete

Format checks tell you an address looks right; they don’t tell you it exists. Address verification and autocomplete cover that gap.

  • Address verification. CheckoutWC checks the shipping address (or the billing address on orders that don’t ship) with Smarty, and offers a corrected address when it finds a close match. The customer chooses Use Recommended or Use Your Address. It needs your own Smarty account, and you turn it on under CheckoutWC » Pages, on the Checkout tab.
  • Address autocomplete. Customers pick their address from suggestions as they type, using Google or Fetchify with your own API key. Smarty still checks the final address, whether it was typed or picked.
  • Postcode lookup. With no setup, CheckoutWC fills in the state, and the city when the postcode belongs to one place, from the postcode alone.

Validate phone numbers and email addresses

For phone numbers, turn on the international phone field. It adds a country picker and checks the number for that country when the phone is required. That beats a pattern that only counts digits, which rejects valid numbers from other countries.

For email, the domain check does most of the work. Occasionally it rejects a real address, such as one on a brand new domain or an unusual company mail server. A developer can allow specific domains without turning the check off; the snippet is in the documentation.

Change error messages and add your own rules

CheckoutWC uses the Parsley validation library, so developers can change a field’s message with the data-parsley-error-message attribute. Add this in a code snippets plugin or CheckoutWC’s PHP Snippets box (CheckoutWC » Advanced, Scripts tab):

add_filter( 'woocommerce_checkout_fields', function ( $fields ) {
	$fields['billing']['billing_first_name']['custom_attributes']['data-parsley-error-message'] = 'Please tell us your first name.';
	$fields['billing']['billing_email']['custom_attributes']['data-parsley-error-message']      = 'Please check your email address.';
	return $fields;
}, 100001 );

Use the same pattern for other fields: the group (billing, shipping or order) and the field’s key, such as shipping_city.

You can also add a rule of your own. This one rejects a street address with no number:

add_filter( 'woocommerce_default_address_fields', function ( $fields ) {
	$fields['address_1']['custom_attributes']['data-parsley-pattern']       = '/^(?=.*\d).+$/';
	$fields['address_1']['custom_attributes']['data-parsley-error-message'] = 'Please include your house number in the street address.';
	return $fields;
}, 100001 );

These checks run in the visitor’s browser, so they improve the form but can’t stop a request that skips the page. If you ship to countries where the house number is entered separately, turn on Enable Separate House Number and Street Name Address Fields instead; the number then gets its own required field. Google and Fetchify address autocomplete can’t be used while the separate fields are on. Other rules, such as a custom validator, a different trigger for when a field is checked, or translated messages, are covered in the custom validation documentation.

Don’t over-validate

Every extra rule is another place a customer can get stuck. You may be over-validating if:

  • you require more fields than you use to fulfill the order;
  • you ask for information that feels intrusive;
  • error messages are long or technical;
  • strict rules, such as password formats, make people stop before they can pay;
  • fields depend on each other, so fixing one breaks another.

The cost shows up in cart abandonment and conversion rate. Ask for essentials only, write short messages, validate inline, and offer guest checkout. Removing a field you don’t need is the cheapest fix, and removing billing address fields takes a few clicks.

Beka Rice, Product Architect at Kestrel, puts it this way: “Every additional field or validation rule is a potential exit point for your customer.”

Get validation that works from the start

CheckoutWC checks fields inline out of the box, and you can add address verification, country-aware phone validation, and your own rules on top. See the features or pricing.

The simplicity of Shopify with the power of WooCommerce. Replace your WooCommerce checkout page with CheckoutWC to boost sales and reduce cart abandonment.

Get Started
Previous Article

WooCommerce guest checkout: how to enable it, plus pros and cons

Next Article

WooCommerce trust badges: plugin, custom code, or built-in?

Ian Misner

Cofounder and general manager at Kestrel, the team behind CheckoutWC, which is used on over 25,000 stores. Kestrel’s founders have built WooCommerce plugins since 2011, starting at SkyVerge.

Share this Post

Table of Contents

  • What WooCommerce validates by default
  • Validate addresses and pair them with autocomplete
  • Validate phone numbers and email addresses
  • Change error messages and add your own rules
  • Don't over-validate
  • Get validation that works from the start

The simplicity of Shopify with the power of WooCommerce. Replace your WooCommerce checkout page with CheckoutWC to boost sales and reduce cart abandonment.

Get Started

Supercharge your WooCommerce checkout

Stop losing sales at the final step. CheckoutWC is a drop-in upgrade that reduces abandoned checkouts and keeps customers happy.
Start Selling More
You won't regret it. We pinky swear.

Account

  • Account
  • Log In
  • Affiliate Program
  • Affiliate Agreement
  • Terms and Conditions and Refund Policy

Product

  • Features
  • Best WooCommerce checkout plugins compared
  • Flux Checkout vs CheckoutWC
  • CartFlows vs CheckoutWC
  • FunnelKit vs CheckoutWC
  • CheckoutWC Demos
  • Testimonials
  • Leave a Review

Support

  • Home
  • Documentation
  • Support
  • Contact
  • Need a Developer?

Our Good Friends

  • WP Sent Mail
  • Advanced Content Templates

Making the world a better place one WooCommerce checkout at a time and one support request at a time.

Made with by KestrelWP Icon Kestrel

Subscribe & Discount

Stay up to date and never miss a promotion, freebie, or update! Get a 10% OFF DISCOUNT for any premium plan for your first subscription year.

Copyright © 2026 CheckoutWC, All rights reserved.
CheckoutWC
Manage Consent

We use technologies like cookies to access or store device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting may adversely affect certain features and functions.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}
CheckoutWC
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}