Title: Create User Programatically
Last modified: August 10, 2020

---

# Create User Programatically

 *  [liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * (@liquidonthedrums)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/create-user-programatically/)
 * I am using Ultimate Member on a membership site and I need a way for logged in
   users to be able to create a new user. Ultimate member doesn’t allow this by 
   default (registration form is not displayed).
 * I have re-created the registration form with Gravity forms so I can collect all
   of the required info, but not sure how to create a user programatically in the
   same way that UM does. I would like users created in this way to have the same
   metadata structure as the ones who come in through the UM registration form.
 * Any help appreciated. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/create-user-programatically/#post-13236892)
 * Hi [@liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * You can create a user with `wp_create_user` function. Once the user is created,
   you can now use the returned `$user_id` from the `wp_create_user` function to
   make additional meta values to the user. You can add a meta to a new user with
   the following code:
 *     ```
       update_user_meta( $user_id, "role", "subscriber" );
       update_user_meta( $user_id, "status", "activated" );
       ```
   
 * Hope this works for you.
 * Regards,
 *  Thread Starter [liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * (@liquidonthedrums)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/create-user-programatically/#post-13236977)
 * Thanks for the response [@champsupertramp](https://wordpress.org/support/users/champsupertramp/).
   Are any of the meta fields required for other functionality to work. eg. any 
   of the UM actions in dropdown the admin/user screen, or the account self-management
   functionality for users.
 * I can see that the standard registration form submits all of the entry values
   in a serialised array. This is stored with the ‘submitted’ meta key. Is this 
   required?
 * I am trying to stick as close to the default UM registration process in order
   to harness as much the in-built logic/workflow/functionality as I can, I just
   need a way for a logged in user to submit a registration form on behalf another
   user.
 * Thanks for your time.
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/create-user-programatically/#post-13237024)
 * Hi [@liquidonthedrums](https://wordpress.org/support/users/liquidonthedrums/)
 * `Submitted` data is for your reference that can be found in the WP Admin > Users
   > see “View Info” when you hover on the list of users. That data is only added
   once but when a user modifies those data in the front-end profile, it won’t be
   updated since it is only a reference when they submit the data via Register form.
 * Regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create User Programatically’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/create-user-programatically/#post-13237024)
 * Status: not resolved