Title: include custom fields during user registration
Last modified: August 24, 2016

---

# include custom fields during user registration

 *  Resolved [nasznjoka](https://wordpress.org/support/users/nasznjoka/)
 * (@nasznjoka)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/include-custom-fields-during-user-registration/)
 * Hi, I am grateful for this plugin. I have a question i need to include custom
   fields to the user while registering. I already seen such issue here and it was
   solved 12 months ago ([https://wordpress.org/support/topic/registration-custom-filed-wp_usermeta?replies=3](https://wordpress.org/support/topic/registration-custom-filed-wp_usermeta?replies=3)),
   but the fix does not fit on this version(latest) of the plugin. for instance 
   you said
    Open the json-api-user/controllers/User.php
 * Find this:
 * if($user_id) $msg = ‘Success’;
 * but there is no such line in the plugin i have(latest)
 * also is there a way to force password instead of wordpress’ default sending generated
   password?
 * [https://wordpress.org/plugins/json-api-user/](https://wordpress.org/plugins/json-api-user/)

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

 *  Plugin Author [Ali Qureshi](https://wordpress.org/support/users/parorrey/)
 * (@parorrey)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/include-custom-fields-during-user-registration/#post-6082936)
 * Hi,
 * Yes, you can do both, use custom fields and set password while registering user..
 * **Method: register**
    `http://localhost/api/user/register/?username=john&email
   =john@domain.com&nonce=8bdfeb4e16&display_name=John`
 * Optional fields: ‘user_pass’, ‘user_nicename’, ‘user_url’, ‘nickname’, ‘first_name’,‘
   last_name’, ‘description’, ‘rich_editing’, ‘user_registered’, ‘jabber’, ‘aim’,‘
   yim’, ‘comment_shortcuts’, ‘admin_color’, ‘use_ssl’, ‘show_admin_bar_front’.
 * To register user with password & custom fields: `http://localhost/api/user/register/?
   username=john&email=john@domain.com&nonce=8bdfeb4e16&display_name=John&user_pass
   =3458uytDG`
 * Once you get user_id after registration:
 * call ‘update_user_meta_vars’ or ‘xprofile_update’
 * **Method: update_user_meta_vars**
    It needs ‘cookie’ and any user meta variables.
   This endpoint allows you cut http requests if you have to add/update more than
   one user_meta field at a time.
 * `http://localhost/api/user/update_user_meta_vars/?cookie=COOKIE-HERE&website=
   user-website.com&city=Chicago&country=USA&skills=php,css,js,web design`
 * in the above call, website, city, country and skills are meta_key for WordPress
   user_meta. It is different from BuddyPress xProfile fields.
 * Please make sure you provide ending comma for all those fields which have multiple
   values. e.g. If ‘skills’ field has multiple values, pass them like [http://localhost/api/user/update_user_meta_vars/?cookie=COOKIE-HERE&skills=PHP,MySQL](http://localhost/api/user/update_user_meta_vars/?cookie=COOKIE-HERE&skills=PHP,MySQL),
   or &skills=PHP, make sure you always pass ending comma for multi-select fields
   to be added in array format.
 * **Method: xprofile_update**
    It needs ‘cookie’ and any profile ‘field’ var and‘
   value’.
 * `http://localhost/api/user/xprofile_update/?cookie=COOKIE-HERE&exact-xprofile-
   field-label=value`
 * `http://localhost/api/user/xprofile_update/?cookie=COOKIE-HERE&field=value&field2
   =value&multi-value-field=value1,value2,value3`
 * Please make sure you provide ending comma for all those fields which have multiple
   values. e.g. If ‘skills’ xProfile field has multiple values, pass them like [http://localhost/api/user/xprofile_update/?cookie=COOKIE-HERE&skills=PHP,MySQL](http://localhost/api/user/xprofile_update/?cookie=COOKIE-HERE&skills=PHP,MySQL),
   or &skills=PHP, make sure you always pass ending comma for multi-select fields
   to be added in array format
 * I hope it works for you.
 * PS: Please consult Documentation available here. [https://wordpress.org/plugins/json-api-user/other_notes/](https://wordpress.org/plugins/json-api-user/other_notes/)
 *  Thread Starter [nasznjoka](https://wordpress.org/support/users/nasznjoka/)
 * (@nasznjoka)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/include-custom-fields-during-user-registration/#post-6083002)
 * thank a lot for such quick response. I think its all clear. I have another issue
   though. I’m sending my data as json and usually using this method normal php 
   post cant catch variables. so it has to be input stream method ie file_get_content(“”)
   and then decode what ever is received to json. So am facing the issue where it
   says you must include username var and i have discovered that that’s the issue.
   is there a way to manually controll how data is received?
 * Thanks

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

The topic ‘include custom fields during user registration’ is closed to new replies.

 * ![](https://ps.w.org/json-api-user/assets/icon-256x256.png?rev=1965790)
 * [JSON API User](https://wordpress.org/plugins/json-api-user/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api-user/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api-user/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api-user/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api-user/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api-user/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [Registration](https://wordpress.org/support/topic-tag/registration/)

 * 2 replies
 * 2 participants
 * Last reply from: [nasznjoka](https://wordpress.org/support/users/nasznjoka/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/include-custom-fields-during-user-registration/#post-6083002)
 * Status: resolved