$current_user = wp_get_current_user(); echo $userid = $current_user->ID; echo $firstName = $_GET['firstname']; echo $lastName = $_GET['lastname']; if(is_admin()){ }else { $user_data = wp_update_user( array( 'ID' => $userid, // this is the ID of the user you want to update. 'first_name' => $firstName, 'last_name' => $lastName) ); if ( is_wp_error( $user_data ) ) { // There was an error; possibly this user doesn't exist. echo 'Error.'; } else { // Success! echo 'User profile updated.'; } } ?>