Website Building » WooCommerce » How Do I Add Email Verification in WooCommerce?

How Do I Add Email Verification in WooCommerce?

Last updated on January 12, 2023 @ 12:48 pm

Adding email verification to WooCommerce is a two-step process. First, you need to add a new user field to your registration form that will collect the email address. Second, you need to add a verification code to the user’s account that they must enter before they can complete the registration process.

Adding the Email Field:

To add the email field to your registration form, you will need to edit the “My Account” page in your WordPress admin. You can do this by going to WooCommerce > Settings > Accounts and then scrolling down to the “Accounts can be verified” section.

Here, you will need to check the “Enable verification” checkbox and then click on the “Save Changes” button.

Once you have saved your changes, you will need to edit the “My Account” page template in your theme. You can do this by going to Appearance > Editor and then selecting the “My Account” template from the dropdown menu on the right hand side.

Once you have opened the template file, you will need to find the line of code that outputs the “register” form. This line of code will look something like this:

PRO TIP: If you are planning to add email verification to your WooCommerce store, it is important to be aware of the potential risks involved. Email verification can be used to collect sensitive information from customers, such as their email addresses and passwords. This information can then be used to spam customers or even hijack their accounts. Additionally, email verification can slow down your store’s performance, so it is important to weigh the pros and cons before deciding to add this feature to your WooCommerce store.
<?php wp_register_form(); ?>

You will need to add a new field for the email address after this line. The code for the email field should look something like this:

<label for="email">Email address:</label> <input type="email" name="email" id="email" required>

Make sure to also add the “required” attribute to the input field, so that the user must enter a valid email address.

Adding the Verification Code:

Once you have added the email field to your registration form, you will need to add a verification code to the user’s account. You can do this by using a plugin like Email Verification for WooCommerce.

This plugin will generate a unique verification code for each new user and send it to their email address. The user will need to enter this code in order to complete the registration process.

Once you have installed and activated the plugin, go to the plugin’s settings page and configure the settings according to your preferences.

Conclusion:

Adding email verification to WooCommerce is a two-step process that requires editing your registration form and adding a verification code to the user’s account. This can help to prevent fake or fraudulent registrations on your store and increase security.

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.