I want to import user information using a CSV file. I am using the BP Groups Import User plugin.

The challenge is to add the first name and last name columns in the CSV file but I cannot get the value to save.

My table is

| email      | first name | last name | moderator | admin |
|[email protected] | max        | biagi     |      1    |   1   |

my code

}else if(isset($_POST['create_user'])) {

                    //Create new user
                    $usermeta = array();
                    $usermeta['first_name'] = ucfirst ($first_name);
                    $usermeta['last_name'] = ucfirst ($last_name); 
                    $usermeta['password'] = wp_hash_password( $email );
                    $user_login = strtok($email, '@');
                    $user_id = bp_core_signup_user( $user_login, $email, $email, $usermeta );

                    //Add user to group
                    groups_join_group($group_id, $user_id );

                    //Promote user to group moderator
                    //Promote user to group administrator

I can only save email.

Is there another way to get the value from the CSV table?

  • Your column names appear incorrect. first name and last name probably need underscores: first_name, last_name. Are the underscores missing in your actual CSV. Does changing this help? Sep 19, 2017 at 6:00
  • thank you but is not get the data. Sep 19, 2017 at 6:18

1 Answer 1



I change my code to wp_insert_user beside bp_core_user_signup

$user_id = wp_insert_user(array(
                            'user_login' => $user_login,
                            'user_pass' => wp_hash_password( $email ),
                            'first_name' => $first_name,
                            'last_name' => $last_name,
                            'display_name' => $first_name . ' ' . $last_name,
                            'user_email' => $email,
                            'user_nicename' => $first_name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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