How to add usermeta via REST API (Developer Tools)

MemberPress Developer Tools add-on allows you to add or update usermeta via your REST requests.

But first you must modify and add the following script to your site. Change the list of allowed keys to match the keys you need:

function define_mepr_api_usermeta_keys($allowed_keys, $user) {
  $allowed_keys['mepr_birthday'] = 'mepr_birthday';
  $allowed_keys['mepr_company'] = 'mepr_company';
  $allowed_keys['any_user_meta_you_need_here'] = 'any_user_meta_you_need_here';
  return $allowed_keys;
add_filter('mepr_developer_tools_member_valid_user_metas', 'define_mepr_api_usermeta_keys', 11, 2);

We recommend putting this into something like the WPCode plugin (please check this article for details: How to add custom code snippets in WPCode), or if you're using a child-theme, then the functions.php file should work as well.

Once the keys are defined, you can then send these keys as parameters in your Create/Update Member requests.

$ curl -X POST "" \
       -d email="" \
       -d username="" \
       -d first_name=Zapier \
       -d last_name=test \
       -d mepr_birthday="12/22/1989"  \
       -d mepr_company="Walmart" \
       -d any_user_meta_you_need_here="Some Value Here"
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.