I'm developing a WordPress plugin and I want to append some extra form fields in add new form of Users section inside admin panel without editing core files. Can somebody help me in achieving this.


As of WordPress 3.0.0 this action is available at the top of the new user form:


As of WordPress 3.7.0 this action is called at the end of the form (right before submit button):


You will however need to intercept when clicking submit to save any specific user information to the user's meta


You will find a lot of tutorials for doing this, take a look here for example : http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

You can use following hooks : show_user_profile, edit_user_profile, personal_options_update, edit_user_profile_update ...

EDIT : But it will not add fields on the "New User" form since there is no hook for that : http://core.trac.wordpress.org/browser/branches/3.3/wp-admin/user-new.php

But you can :

  • try to add needed fields using javascript, and use user_register hook to add user meta data in db.
  • Or build your own form.
  • I want to add form fields on new user registration form i.e on "add new" page of users section. The link only shows how to add such functionality on "edit-user" and "your profile" page of users section. – Krishna Apr 19 '12 at 8:35
  • Sorry, answer updated. – soju Apr 19 '12 at 8:51
  • please don't answer just because you have to. read the question properly. – Hasin Hayder Oct 2 '12 at 3:27
  • Please don't comment if you don't have any useful information to give. – soju Oct 2 '12 at 6:41
  • 2
    That's the point of this site, to ask, to answer. Sometimes we make mistakes. That's what down-voting is for, in cases where bad advice/incorrect answers are given, assuming the user doesn't make the effort to correct his/her answer. But without genuine contributions from users this resource doesn't exist. Point in case, if Soju didn't answer this question, it'd still be unanswered. Now who does that help? – Adam Oct 29 '12 at 14:41

You can use this filter to add your fields:

apply_filters( 'show_password_fields', true );
add_filter( 'show_password_fields', 'yourfunction', 10, 1 );
function yourfunction( $return ) {
        <th><label for="gender">Gender</label></th>
            <label><input type="radio" name="w4p_user_gender" value="male" class="regular-radio" />Male</label>
            <label style="margin-left:10px"><input type="radio" name="w4p_user_gender" value="female" class="regular-radio" />Female</label><br/>
            <span class="description">Please select your Gender.</span>
    return $return;

I don't know if it's a good idea or not, but it works for me. :)

  • But, does this works for custom user meta? As far as I tested, only for default user meta... Are you doing something like this? – brasofilo Dec 5 '12 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.