You don’t need to re-import the CSV to add metas. Assuming you want to do this for every user on the site here is what you do.
$users = get_users(); // this will get all users on your site.
// loop through each user updating their meta
foreach( $users as $user ) {
// whatever key/value pair you want to add to each user
// you can have as many as you want
update_user_meta( $user->ID, $meta_key, $meta_value );
}
Put this in your theme’s functions.php file and load your site ONCE. Because this temporary code will execute on each page load so just load it once and remove this code. This will successfully add the meta you want to each user.
Related Posts:
- Find out if logged in user is not subscriber
- Get multiple roles with get_users
- How to Merge Two Authors Into One?
- Whats the best way to share user data across multiple WordPress websites?
- Delete all subscribers from wp_users and wp_usermeta a few thousand at a time
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- Hide Admin Menu for Specific User ID who has administrator Role
- Allowing an email as the username?
- Get the name of user who updated post
- Disable delete user
- Display edit link if post author is current user
- Change user’s display name programmatically
- Do not allow users to create new posts and pages
- Send activation email to user after signup [duplicate]
- wp_update_user() does not update user_data
- Set user after wp_create_user?
- Sort get_users by custom field
- How to add follow functionality to multi-author wordpress site?
- Search multiple meta keys at once
- Get user input from a form
- Redirecting user after updating profile?
- How to add new custom field in default add user form through plugin
- How to add wordpress username after url?
- ACF Upload Image in front-end with custom form
- User fields that can be edited by administrator?
- Admins can’t edit each other’s posts
- Update user_login to change username
- Can I bulk register contributors for a new blog
- show cimy user fields in users.php with manage_users_columns
- Why i getting blank user_activation_key in get_user_by( ‘login’, $login ) function?
- how do i get a greeting for logged in uses by the time of day
- Can’t add users in admin after copying database
- How can i create an array user meta?
- Getting users by specific capability, not role
- Creating user in Firebase after WordPress user registration
- Exclude admin from user list
- When I try to login in wordpress it is showing “USER Doesn’t Exists”
- Displaying different in-page content to cliente/admin
- Can i add password field into my wp registration form?
- User capability for editing their own comments
- Delete User via Frontend
- how to get WordPress admin user table columns name in my plugin
- Allow Contributors to Upload Files
- Limit a number of users returned from sorting users by latest posts function
- Will wordpress tools import do everything I need to copy one site to another
- Create Next and Previous Link to User orderby Last Name
- Accessing current users data within a plugin
- Spam users registers even when registration is disabled
- Limitations when adding new users
- User description only displayed for logged user
- Fetch all data of Users
- Get an array of all users of a custom role type to send an email notification on post update
- Allow users to create post without logging in?
- WordPress Password security related questions
- How to make Users sort in reverse order by default?
- Assign random (and unique) user meta upon registration
- How do you manage your pages or functions that require logged-in users?
- How to get ID of Edit User page during wp_handle_upload_prefilter, whilst in Media picker?
- What is correct way to change user’s email?
- Display the line breaks in user bio without using html
- Querying specific table row by current user login
- Get registered user’s country or IP
- How to make current user’s avatar + display name link to their profile?
- Import users once a day without a plugin
- Custom capability for a single user
- Adding more fields to the add user page on dashboard
- Change User Role based on Point System Issue
- Allow Weak Passwords
- How do I modify the user role ‘subscriber’ to allow the user to delete posts
- delete_user_meta from a foreach results page
- Is it possible with a code snippet to display a green dot on top of every avatar on a WordPress site for each user that is online?
- How to display all user profile info in myaccount page wordpress
- Need to use WordPress page as authentication for different service
- Reading additional fields in PMPro
- How to put the ‘assign to new user’ select when you delete a user that has custom post type posts, but no normal posts
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- wordpress Account Management generate password missing on my laptop
- Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
- How to make custom user profile page public?
- Disable emails for new user registration
- Query for post term that matches user ID
- User Role not showing in Users Screen
- Change user URL
- User email verification without a plugin, is it possible?
- Deleting anonymous wp_users function not working?
- Add method for tracking who referred new users
- Resend user activation mail
- Cloning admin pages like users.php
- User count only for role frontend vendor
- Changing user_login ends current session
- Restrict access to certain dashboard pages based on user id
- how to show logged in members username in wordpress content
- How to expire guest users after 1.5 hours logged in?
- hide woo commerce dashboard status and reports from woo commerce from specific users but display to other users
- WordPress – Security Question at Login from User’s Meta Data
- determine active user browser at the same time
- get Discussion setting in wordpress
- Set a minimal number for next user_id
- Remove My Account Menu items in Woocommerce based on user roles