How to Add Custom Fields in User Registration in WooCommerce

Prem Tiwari - - WooCommerce, WordPress

Sometimes we need to add the extra fields in the WooCommerce registration form to get some more information, which by default you can’t get from the registration page. In this tutorial, I will share how to add custom fields in user registration on the “My Account” page.

There are two ways to add the custom fields in the registration form, first is by creating a custom WordPress plugin by using the below code snippets or secondly you can add below code directly in your functions.php file. By default my account page has only two fields email address & password, see the below screenshot.

WooCommerce My account page

How to Add Custom Fields in User Registration in WooCommerce

Let’s follow the below steps, In this tutorial, I am going to add First name & Last name on the registration form. Add Below code to your functions.php file.

Now add the below code to validate the First name & last name. Copy paste the below code after the above code inside the functions.php file.

Now add the below code inside the functions.php filSave the extra register fields

After adding the above code in your functions.php file, your my account page will look like the below screenshot.

After WooCommerce My account page

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

About: Prem Tiwari

Prem Tiwari is the founder of and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

Tags: , , , ,