=== Import and export users and customers === Contributors: carazo Donate link: https://codection.com/go/donate-import-users-from-csv-with-meta/ Tags: import users, export users, csv, migrate users, bulk import Requires at least: 5.5 Tested up to: 7.0 Stable tag: 2.4.13 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Bulk import and export WordPress users and WooCommerce customers from CSV, including roles, passwords and any custom meta. == Description == **Try it out on your free dummy site: Click here => [https://demo.tastewp.com/import-users-from-csv-with-meta](https://demo.tastewp.com/import-users-from-csv-with-meta)** Import, export and migrate WordPress users and WooCommerce customers from a CSV file. Bulk-create or update thousands of users in seconds, schedule automatic recurring imports from a local file or URL, and carry over roles, passwords and any custom meta field. Works with WooCommerce, BuddyPress, Advanced Custom Fields, Paid Membership Pro, WooCommerce Memberships, WooCommerce Subscriptions and many more. * Import CSV file with users directly to your WordPress or customers into WooCommerce * Import thousands of users or customers in only some seconds * Export users or customers to a CSV file, filtering by role or registered date * You can also import meta-data like data from WooCommerce customers * You can assign roles while importing. * Send a mail to every new user, this mails can be saved as templates and are fully customizable, before sending you can test it * You can also update users if the user is already in your WordPress * Create a cron task to import users periodically * Edit the metadata (you will be able to edit the metadata imported using metakeys directly in the profile of each user) * Extend the plugin using the hooks we provide * Compatible with WPML [read the documentation](https://wpml.org/documentation/plugins-compatibility/import-users-from-csv-with-meta-and-wpml/) to see how you can translate the front-end import and export users page and send translated email notifications to users Moreover this plugin is compatible with many other plugins to be able to import and include them data, subscriptions, memberships, etc. Take a look: * WooCommerce: to import the customer data * WooCommerce Memberships: to import memberships * WooCommerce Subscriptions: to create subscriptions associated with users while they are being imported * BuddyPress: to import custom BuddyPress avatars, fields, groups and roles * Advanced Custom Fields: to import data to the fields you define there * Paid Membership Pro: to import memberships, included compatibility with PMPro version 3 * Indeed Ultimate Membership Pro: to import memberships * Paid Member Subscriptions: to import memberships * Allow Multiple Accounts: plugin will allow the same rules importing than this plugin * Groups: to assign users to groups while importing * New User Approve: you can import users and approbe/wait for approve them * Users Group: to assign users to groups while importing * WP LMS Course: to enroll users in the courses while importing * WP Members: to import memberships * WP Users Group: to assign users to groups while importing * WooCommerce Membership by RightPress: to create memberships while users are being imported * WP Private Content Plus: To import and export the groups to which users are assigned If you have some problem or doubt: * Read our documentation * Ask anything in support forum, we try to give the best support ### **Common use cases** * Migrate users from one WordPress site to another * Bulk create or update WooCommerce customers from a spreadsheet * Sync users automatically from an external CRM or ERP via CSV * Onboard members to a membership site (Paid Membership Pro, WooCommerce Memberships) * Periodically import subscribers or students from an external list * Import users from the frontend using a shortcode ### **Usage** Once the plugin is installed you can use it. Go to Tools menu and there, there will be a section called _Insert users from CSV_. Just choose your CSV file and go! ### **CSV generation** You can generate CSV file with all users inside it, using a standar spreadsheet software like: Microsoft Excel, LibreOffice Calc, OpenOffice Calc or Gnumeric. You have to create the file filled with information (or take it from another database) and you will only have to choose CSV file when you "Save as..." the file. As example, a CSV file is included with the plugin. ### **Some considerations** Plugin will automatically detect: * Charset and set it to **UTF-8** to prevent problems with non-ASCII characters. * It also will **auto detect line-ending** to prevent problems with different OS. * Finally, it will **detect the delimiter** being used in CSV file == Frequently Asked Questions == = I get a "too many redirects" error on my site, how can I solve it? = This is caused by the option that forces the users to reset their password. When it is used, each of those users is redirected to their password page on every page load until they change it, and if that destination cannot be reached (for example, because wp-admin is blocked for customers or subscribers by WooCommerce, by a membership plugin or by a security plugin) the browser ends up in a redirection loop. Since version 2.4.12 the plugin detects this situation and gives up after 3 consecutive redirects, so the site stays usable, but you can also clear the flag for the users that are already affected: go to the plugin documentation tab and use the button that removes the force reset password metadata from all the users. If you want to change how many redirects are allowed before the plugin gives up, use the `acui_force_reset_password_max_redirects` filter (return 0 to disable the limit): `add_filter( 'acui_force_reset_password_max_redirects', function( $max ){ return 5; } );` = Which page are the users sent to when I force them to reset their password? = By default they are sent to their WordPress profile page. If WooCommerce or WP User Manager are active, they are sent to the password section of the account page of those plugins instead. You can point them anywhere else using the `acui_force_reset_password_edit_profile_url` filter, and you can add your own exceptions (pages where the redirection must not happen) using `acui_force_reset_password_redirect_condition`. == Screenshots == 1. Import dialog 2. Recurring import dialog 3. Export dialog 4. File sample 5. Extra profile information (user meta) == Changelog == = 2.4.13 = * Improvement: the role errors during the import now say exactly what is wrong instead of always blaming permissions. The row is checked role by role and the message tells which single role failed and why: the role does not exist (and lists the roles that can be used), the role exists but the current user is not allowed to assign it (and lists which ones they can), or the role column is empty on that row. Before, a role that simply did not exist was reported as *"You do not have permission to assign some of the next roles"* whenever the "update roles of existing users" option was set to "no", because the "role does not exist" check was skipped in that case, and both messages printed the whole list of roles of the row instead of the offending ones * Improvement: when the CSV carries the name of the role (`Conference`) instead of its slug (`conference_member`), the error now points to the right slug instead of only saying that the role does not exist * Fix: roles whose slug contains uppercase letters (created that way by some role editor plugins) can be imported again. The values of the `role` column were lowercased but compared against the role slugs as they are stored, so those roles were always rejected as non existing or invalid * Fix: `ACUI_Helper::get_editable_roles()` uses `wp_roles()` instead of reading the `$wp_roles` global directly, which could still be uninitialized in cron or front end imports, leaving the list of editable roles empty and making every role of the CSV fail * Fix: a `role` cell containing the `::` list separator no longer produces a fatal error when the row is prepared = 2.4.12 = * Fix: the "force users to reset their password" option no longer produces "too many redirects" errors. The redirection ran on every front end page load and only stopped when the add-on condition matched exactly, so any setup where the destination could not be reached or recognized (wp-admin blocked for customers by WooCommerce or a membership plugin, a My account URL that did not match the `home_url()` string comparison because of trailing slashes, www, https or a language prefix, an account page built with blocks or a page builder instead of the shortcode...) sent the user back and forth forever. The redirection is now skipped when the user is already on the destination URL, it does not run on AJAX, REST, cron, XML-RPC or non GET requests, and a counter stops it after 3 consecutive redirects (filterable through the new `acui_force_reset_password_max_redirects` hook) so the worst case is that the password change is not enforced instead of the site being unreachable = 2.4.11 = * Security fix: the mail options save handler no longer writes to arbitrary posts. The `template_id` form field was passed straight to `wp_update_post()` without checking the post type or `current_user_can( 'edit_post' )`, so a user with only the `create_users` capability could overwrite the title and the content of any post or page of the site (and inject arbitrary CSS through the `