Focused senior woman reading with magnifier

How many times did you want to get in touch with your customer after they purchased but their email address was wrong, or they contacted you to change it since they had a typo? I feel this is a common issue with many shop owners. The easy solution is to force customers to confirm the email address on the Checkout page.

Let’s see how to do it!

As you probably guessed, this requires a little snippet. Open your functions.php file in wp-content/themes/your-child-theme-name/ and add this code at the end of the file:

The first function adds the field. You can change its label there. You can also change how the field looks like, maybe you want this to show on the same row as the Billing Email field. If you want to do that, I recommend checking this article on the WooCommerce documentation about Customizing checkout fields using actions and filters.

The second function instead confirms if the billing email matches the confirmation billing email. If not, it shows an error on the Checkout page and stops the checkout process. The system will already take care of verifying that the email confirmation field is not empty, so we do not need to verify that ourselves, but we how an error only if the field is not empty. This is because otherwise it would show the matching error even if the Confirm Email Address field is empty, which I did not like.

This is how it looks like on Storefront:

The WooCommerce checkout page with the Confirm Email Address field shown along the regular Email address field.
The Confirm Email Address field as shown on the Checkout page with the theme Storefront active.

Did you ever have an issue with wrong billing data on your store? Tell me about it in the comments!

Contribute to Improving This Blog

Did you enjoy this article? Was it helpful? Contribute to help me writing more articles! The funds collected from this blog are reinvested directly into improving my skills or the blog so that I can provide more and better content!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

Do you prefer using cryptocurrency? I’ve got you covered! You can donate at the following wallets:

  • BTC: bc1q87nxpdpqw323ccmerrzyeffs72wnxpw93x7pzk / 17Gtc5e8yoh2LZzokoyK8P5DWbToBwztok
  • ETH: 0xA5C89Be1df2896C3942DBEf751cCeacC7929388b

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply