How to Add Custom Fields in User Registration in WooCommerce

By Prem Tiwari in WooCommerce, WordPress. Updated on

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.

Sharing is caring!

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

You might also like:

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.