How To Add Custom Form Fields To The User Profile Page?

The user profile page has the following fields:

First Name
Last Name
Display name
Contact Info
Yahoo IM
Jabber / Google Talk

How can more fields be added to this section. Field such as Phone number, address, or anything else.


You need to use the 'show_user_profile', 'edit_user_profile', 'personal_options_update' and 'edit_user_profile_update' hooks.

Here’s some code to add a Phone number:

add_action( 'show_user_profile', 'yoursite_extra_user_profile_fields' );
add_action( 'edit_user_profile', 'yoursite_extra_user_profile_fields' );
function yoursite_extra_user_profile_fields( $user ) {
  <h3><?php _e("Extra profile information", "blank"); ?></h3>
  <table class="form-table">
      <th><label for="phone"><?php _e("Phone"); ?></label></th>
        <input type="text" name="phone" id="phone" class="regular-text" 
            value="<?php echo esc_attr( get_the_author_meta( 'phone', $user->ID ) ); ?>" /><br />
        <span class="description"><?php _e("Please enter your phone."); ?></span>

add_action( 'personal_options_update', 'yoursite_save_extra_user_profile_fields' );
add_action( 'edit_user_profile_update', 'yoursite_save_extra_user_profile_fields' );
function yoursite_save_extra_user_profile_fields( $user_id ) {
  $saved = false;
  if ( current_user_can( 'edit_user', $user_id ) ) {
    update_user_meta( $user_id, 'phone', $_POST['phone'] );
    $saved = true;
  return true;

That code will add a field to your user screen that looks something like this:

There are also several blog posts available on the subject that might be helpful:

  • Adding and using custom user profile fields
  • Adding Extra Fields to the WordPress User Profile

Or if you prefer not to roll-your-own there are plugins that add said features such as the following (although I’m sure there are others):

  • Cimy User Extra Fields

Leave a Comment