1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Additional registration fields
  1. Home
  2. Knowledge Base
  3. Registration
  4. Additional registration fields

Additional registration fields

You can enable additional registration fields in the WooCommerce registration form for new users.

Members Only currently allows you to add all billing and shipping fields to the registration form. You can also add a field for a company’s VAT number.

To add a custom field, see below.

To add new fields:

  • Go to WooCommerce > Settings > Members Only > Registration
  • Check the fields that you’d like to enable for the registration form
  • Select which fields the users will be required to complete by checking the ‘Required’ box
  • You can use the ‘Priority’ field to determine the order in which fields appear on the registration form. Fields with lower priorities appear first.
WooCommerce additional registration fields

Enable a ‘User Role’ select field

You can display a select field in the registration form to allow the user to choose their user role:

  • Go to WooCommerce > Settings > Members Only > Registration
  • Check the ‘Enable Roles Field’ option
  • In the ‘Registration Roles’ list, check the fields that you would like to display as options in the registration form
  • If you are using the user approval feature, you can specify which roles will need to be approved and which roles will automatically get registered by selecting them in the ‘Needs Approval’ column

Add a custom field

You can easily add custom fields to your registration form using a simple filter:

<?php
/**
* Add custom field to registration form
*/
function my_prefix_registration_fields( $fields ) {
// Add a text field
$fields['new_field'] = array(
'label' => __( 'New Field', 'wcmo' ),
'type' => 'text',
'priority' => 250,
'add_to_profile' => true // Select this if you wish to display this field in user profiles
);
// Add a select field
$fields['new_field'] = array(
'label' => __( 'New Select Field', 'wcmo' ),
'type' => 'select',
'priority' => 300,
'options' => array(
'option-1' => 'Option 1',
'option-2' => 'Option 2'
),
'add_to_profile' => true // Select this if you wish to display this field in user profiles
);
return $fields;
}
add_filter( 'wcmo_registration_fields', 'my_prefix_registration_fields' );

This is how to add the snippet.

Was this article helpful?

Need More Support?

If you can't find the answer that you're looking for, then please use the link below to raise a support ticket.
Contact Support

Related Articles