Adding Custom Fields to WordPress User Profile

Adding Custom Fields to WordPress User Profile

A need to add custom fields to the WordPress user profile might arise in order to collect more information about our website users.

For example, WordPress profile doesn’t include a gender field thus; we are oblivious of the number of users that are males and females.

How about the Contact info section? By default, only E-mail and website form fields are present.

WordPress user contact methods

In this tutorial, I will show us how to add more contact methods and custom fields to the WordPress profile using the ProfilePress plugin.

Firstly, ensure you have the Custom Fields addon enabled. Here’s how to activate and deactivate addons.

Adding User Contact Methods

Adding contact methods to the “contact info” section of WordPress user profile is as easy as filling a simple form.

Go to Settings >> Custom Fields and click the Contact Info sub-menu.

Click the Add New button.

Enter a label and key for the contact info field (see image below) where `key` is a unique name use internally by WordPress to recognize the field and `label` the description of the field displayed to users.

After submitting the form, check your profile or that of a user and will see the contact method added to the contact info section.

User contact method added to WordPress profile's contact info section

Adding Custom Profile Fields

When you add custom profile fields via ProfilePress, they are automatically added to the Other Information profile section.

Follow the steps below.

Go to Settings >> Custom Fields and ensure you are on the Custom Fields sub-menu.

Click the Add New button.

Fill out the form with the field details and then hit the submit button.

Field Label: the text that will be shown beside the custom field.

Field Key: the key is used internally by ProfilePress in creating and saving values for the custom field.

Field Description: the text that will be shown below the custom field.

Type: The form element to use as the form field.

Options: only for use when multiple choices i.e. select, check box and radio buttons is chosen as the field type.
Say you want to add a radio button with options “yes” and “no”; choose Radio Buttons in Type and add the radio button options to the Options field separated with a comma ( i.e. yes, no ).

You should now see the custom fields added to users’ profile.

Custom fields in WordPre

Sorting the Contact Info and Custom Fields

The contact methods and custom fields added to the WordPress user profile can be sorted or re-arranged by drag-and-drop.

Easy isn’t it?