How to Add WooCommerce Custom Registration Fields
Last edited on April 6, 2026

The default WooCommerce registration form is intentionally minimal, it only collects a username, email address, and password. For many online store owners, this level of information is simply not enough. Whether you run a wholesale shop that needs a business name, a service-based store that requires a phone number, or a membership site that asks for specific preferences, collecting the right data at the point of registration can make a significant difference in how you manage customers and personalize their experience.

This guide covers three proven methods to add custom fields to your WooCommerce registration form, using PHP code with action hooks, using the built-in woocommerce_form_field() function, and using a dedicated plugin, along with best practices and common troubleshooting tips.

Why Add WooCommerce custom registration fields Form?

WooCommerce custom registration fields

Adding custom fields to the WooCommerce registration form goes beyond simple data collection. Here are the key benefits:

  • Better customer understanding: Collecting additional information lets you know your customers from the moment they sign up, making it easier to serve them appropriately.
  • Personalized experience: Extra data, like preferences or location, enables you to tailor product recommendations and communications.
  • Streamlined checkout: Pre-collecting billing details (first name, last name, phone) during registration means customers don’t need to re-enter information at checkout.
  • Improved support: A well-filled customer profile helps support teams address queries and resolve issues more efficiently.
  • Better marketing segmentation: Custom fields such as preferred categories or business type allow for more targeted email campaigns and promotions.

Enable Customer Registration

Before adding any custom fields, make sure the registration form is actually visible on your store. By default, it may be disabled.

  1. From your WordPress dashboard, navigate to WooCommerce → Settings → Accounts & Privacy.
  2. Enable “Allow customers to create an account on the ‘My account’ page” and/or “Allow customers to create an account during checkout”.
  3. Save your settings.

Once this is done, a registration form will appear on the My Account page at the front end of your store.

Add Custom Fields Using PHP and Action Hooks

This method involves adding code directly to your theme’s functions.php file (or a custom plugin). It gives you full control and doesn’t require installing any additional plugins.

Important: Always use a child theme when editing functions.php. Modifying the parent theme file means your changes will be lost when the theme updates.

Add the Custom Fields to the Form

WooCommerce provides several action hooks that let you inject HTML fields at different positions in the registration form:

  • woocommerce_register_form_start: Adds fields at the very beginning of the form
  • woocommerce_register_form: Adds fields just before the Register button
  • woocommerce_register_form_end: Adds content after the Register button

Here’s an example that adds First Name, Last Name, and Phone Number fields:

function custom_woocommerce_registration_fields() {
    ?>
    <p class="form-row form-row-first">
        abel for="reg_billing_first_name">
            <?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span>
        </label>
        <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name"
            value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" />
    </p>

    <p class="form-row form-row-last">
        abel for="reg_billing_last_name">
            <?php _e( 'Last name', 'woocommerce' ); ?> <span class="required">*</span>
        </label>
        <input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name"
            value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" />
    </p>

    <p class="form-row form-row-wide">
        abel for="reg_billing_phone">
            <?php _e( 'Phone number', 'woocommerce' ); ?>
        </label>
        <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone"
            value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" />
    </p>

    <div class="clear"></div>
    <?php
}
add_action( 'woocommerce_register_form_start', 'custom_woocommerce_registration_fields' );

Fields prefixed with billing_ are automatically linked to the WooCommerce billing address system. The following standard billing fields are available:

Field NameDescription
billing_first_nameCustomer first name
billing_last_nameCustomer’s last name
billing_companyCompany name
billing_address_1Primary street address
billing_address_2Apartment, suite, etc.
billing_cityCity
billing_postcodePostal / ZIP code
billing_countryCountry
billing_stateState or province
billing_emailEmail address
billing_phonePhone number

Step 2: Validate the Fields

After adding the fields, add validation logic to ensure users submit correct data. The woocommerce_register_post hook is designed for this purpose:

function custom_validate_registration_fields( $username, $email, $validation_errors ) {
    if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {
        $validation_errors->add(
            'billing_first_name_error',
            __( '<strong>Error</strong>: First name is required!', 'woocommerce' )
        );
    }

    if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {
        $validation_errors->add(
            'billing_last_name_error',
            __( '<strong>Error</strong>: Last name is required!', 'woocommerce' )
        );
    }

    return $validation_errors;
}
add_action( 'woocommerce_register_post', 'custom_validate_registration_fields', 10, 3 );

This code checks the $_POST array for empty required values and returns a WP_Error object with a descriptive message if validation fails.

Step 3: Save the Values to the Database

Once validated, the custom field values must be saved to the database using the woocommerce_created_customer hook, which fires after a new customer account is successfully created:

function custom_save_registration_fields( $customer_id ) {
    if ( isset( $_POST['billing_first_name'] ) ) {
        update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
        update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
    }

    if ( isset( $_POST['billing_last_name'] ) ) {
        update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
        update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
    }

    if ( isset( $_POST['billing_phone'] ) ) {
        update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) );
    }
}
add_action( 'woocommerce_created_customer', 'custom_save_registration_fields' );

Note that sanitize_text_field() is used on all input values, this is a critical security step to prevent malicious data from being stored in your database.

Using the woocommerce_form_field()Function

WooCommerce includes a built-in helper function, woocommerce_form_field(), that generates properly styled form fields without writing raw HTML. This approach is cleaner, more maintainable, and automatically respects your theme WooCommerce styles.

Basic Structure

function custom_woocommerce_hook_fields() {
    $fields = array(
        'social_media_profile' => array(
            'type'        => 'text',
            'label'       => __( 'Social Media Profile URL', 'your-text-domain' ),
            'placeholder' => __( 'https://example.com/yourprofile', 'your-text-domain' ),
            'required'    => false,
        ),
    );

    foreach ( $fields as $key => $field_args ) {
        woocommerce_form_field( $key, $field_args, isset( $_POST[$key] ) ? $_POST[$key] : '' );
    }
}
add_action( 'woocommerce_register_form', 'custom_woocommerce_hook_fields', 15 );

Supported Field Types

This approach supports a wide range of field types that you can define inside the array:

Text Input:

'type' => 'text',
'label' => __( 'Company Name', 'your-text-domain' ),
'required' => true,

Textarea:

'type' => 'textarea',
'label' => __( 'Tell us about yourself', 'your-text-domain' ),
'required' => false,

Checkbox:

'type' => 'checkbox',
'label' => __( 'I agree to receive marketing emails', 'your-text-domain' ),

Select Dropdown:

'type'    => 'select',
'label'   => __( 'How did you hear about us?', 'your-text-domain' ),
'options' => array(
    ''          => __( 'Select an option', 'your-text-domain' ),
    'google'    => __( 'Google Search', 'your-text-domain' ),
    'social'    => __( 'Social Media', 'your-text-domain' ),
    'friend'    => __( 'Friend or Colleague', 'your-text-domain' ),
),

The values collected this way can be saved to the database using the same wooc_save_extra_register_fields() function described in Method 1.

Add Custom Fields Using a Plugin

If you prefer a no-code approach or need advanced field types and conditional logic, several plugins make it straightforward to build and manage custom registration forms.

User Registration by WP Everest

This is a popular drag-and-drop form builder that integrates seamlessly with WooCommerce. Here’s how to set it up:

  1. Go to Plugins → Add New in your WordPress dashboard.
  2. Search for “User Registration” by WP Everest.
  3. Install and activate the plugin.
  4. Navigate to User Registration → Add New.
  5. Choose a template or start from scratch. Name your form.
  6. Use the drag-and-drop builder to add fields, including basic fields like email, username, and password, as well as any custom fields you need.
  7. Once done, go to User Registration → All Forms to find the shortcode for your form (e.g., [user_registration_form id="123"]).
  8. Create or edit a page, add a Shortcode block, paste the shortcode, and publish the page.

WooCommerce Custom User Registration Fields (Official Extension)

The official WooCommerce extension for custom registration fields offers:

  • Support for 17 different field types, including text, textarea, checkbox, radio, select, file upload, and date picker
  • Conditional logic, show or hide fields based on other field selections
  • Ability to display fields on the “My Account” page post-registration
  • User role management, add a dropdown that lets customers select their role (useful for B2B or wholesale stores)
  • Manual or auto-approve new user registrations
  • Email notifications to admins and customers

Third-Party Plugins (Extensions, Addify, CodeCanyon)

Several third-party plugins offer similar or extended functionality:

FeatureUser Registration (WP Everest)WooCommerce Extension (Official)Extendons / Addify
Field typesStandard + custom17 types17 types
Drag & drop builder
Conditional logicLimited
User role management
Free version available✅ (basic)
Checkout page fields

Best Practices for Custom WooCommerce Registration Fields

Following these guidelines ensures a smooth experience for both users and store administrators:

  • Keep it relevant: Only collect data that genuinely benefits your store operations or improves the customer experience. Asking for irrelevant information frustrates users and increases form abandonment.
  • Limit the number of fields: More fields mean higher friction. Only make a field required if the information is truly essential. Optional fields should be clearly labeled as such.
  • Choose the right field type: Use dropdowns for predefined options, checkboxes for binary choices, and text inputs for free-form data. Using the wrong field type creates confusion.
  • Arrange fields logically: Group related fields together (e.g., name fields side by side) and follow a natural flow from basic to specific information.
  • Always sanitize and validate input: Never trust user input directly. Use sanitize_text_field(), is_email(), and wc_clean() as appropriate before saving to the database.
  • Ensure mobile responsiveness: Registration forms must display correctly on all screen sizes. Test on mobile devices and use CSS classes like form-row-wide, form-row-first, and form-row-last appropriately.
  • Test thoroughly: After implementing custom fields, test the full registration flow: submit valid data, submit invalid data, and verify that saved data appears correctly in the admin user profile and at the checkout page.
  • Use a child theme or custom plugin: Never modify your parent theme’s functions.php directly. A child theme or a dedicated site-specific plugin protects your code from being overwritten during theme updates.

Troubleshooting Common Issues

Registration Form Not Displaying

If the form is not visible on the My Account page, check that registration is enabled:

  • Go to WooCommerce → Settings → Accounts & Privacy.
  • Confirm “Allow customers to create an account on the ‘My account’ page” is checked and saved.

Custom Fields Not Appearing

If fields added via functions.php don’t show up:

  • Verify the code was added to the active theme functions.php or a custom plugin.
  • Check that the correct action hook is used (woocommerce_register_form_start or woocommerce_register_form).
  • Temporarily disable other plugins to rule out hook conflicts.

Field Values Not Being Saved

If user data isn’t being stored after registration:

  • Confirm the woocommerce_created_customer action is properly hooked to your save function.
  • Verify the $_POST key names in your save function exactly match the name attributes in the HTML input fields.
  • Check for theme or plugin conflicts by switching to a default WordPress theme.

Email or Username Already in Use Errors

If this error appears with unique credentials:

  • Check that there no conflicting plugin interfering with the registration validation process.
  • Consider using a plugin with built-in social login support (e.g., User Registration) that handles duplicate detection gracefully.

Registration Form Styling Issues

If the form doesn’t match your store’s design:

  • Use your browser’s developer tools to inspect applied CSS classes.
  • Add custom styles using a child theme’s style.css or a custom CSS plugin, avoid editing core WooCommerce CSS directly.

Frequently Asked Questions

Navigate to WooCommerce → Settings → Accounts & Privacy and enable the option to allow customers to create an account on the My Account page.

Install a plugin such as reCAPTCHA for WooCommerce, activate it, and configure it with your Google reCAPTCHA site key and secret key. This adds an anti-spam layer to the registration form.

Yes. Some premium plugins, like the official WooCommerce Custom Registration Fields extensio,n support displaying custom fields on the checkout page in addition to the My Account page.

About the writer

Hassan Tahir Author

Hassan Tahir wrote this article, drawing on his experience to clarify WordPress concepts and enhance developer understanding. Through his work, he aims to help both beginners and professionals refine their skills and tackle WordPress projects with greater confidence.

Leave a Reply

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

Lifetime Solutions:

VPS SSD

Lifetime Hosting

Lifetime Dedicated Servers