donate

Add Multiple Users for WordPress

If you are not redirected automatically, please visit the new plugin site at http://addmultipleusers.happynuclear.com

Add Multiple Users (AMU) is an admin plugin for WordPress that allows you to bulk register users manually, through CSV file upload, or through a list of email addresses.

Screenshot of AMU Admin Panel

The AMU plugin to register many users at a time, setting a unique username, role, optional password and email address, as well as first name, last name and website fields. This is useful if you have a backlog of users you want to bulk add to your site, or for any other purpose where the 'one-by-one' process is too slow.

Features

Download

Version 1.2.2 modifies the 1.2.1 release to better allow for large volumes of user additions at a single time by adding a Skip Form function on the CSV/TXT and Email List functions. Please see the Memory Browser Issues section below for more information.

» Download Version 1.2.2 at WordPress.org

Beta Version 2.0.0

Version 2.0.0 of Add Multiple Users features an overhaul of existing functionality to expand the usefulness of the plugin. Changes include:

You may download the beta version of 2.0.0 here.

Please note that this version of the plugin is in testing and is not recommended for production sites. I also do not recommend you run it alongside previous versions.

If you would like to test the new version of the plugin, please download it and upload it to your WordPress plugins folder and activate the plugin through the Plugins interface. Play around with it, and if you notice a bug or have any feedback you'd like to give me (or any additional feature requests) please post them on the WordPress forums for the plugin. I would like to hear of any problems, performance issues, general praise or complaints. Anything really, let me know.

Also please note that most of the information on this page will not be applicable for the new version. Please read the updated information inside the beta plugin.

Installation

  1. Unzip the download file and upload the add-multiple-users folder to your WordPress plugins directory
  2. Activate the plugin from your Plugins section of your WordPress site
  3. Access the interface by clicking the Add Multiple Users link under the Users tab in the admin menu

Usage

  1. Access the Add Multiple Users plugin page.
  2. Modify your Settings by choosing the Settings option in the menu and setting your desired options
  3. Choose one of the new user tools to begin bulk adding users (Blank Form, CSV/Text Upload, CSV Input, Email List)
  4. Follow the steps on each tool's page as directed

Note: several functions included with the plugin require javascript to be enabled on your browser.

KNOWN ISSUE: Memory/Browser Issues when adding a high volume of users

In some cases you may try to add many users at once and the script will either terminate early, or you will see a notice saying that new users have been added, yet nothing actually happens.

In most cases you shouldn't have any issues using the tools to add under 500 users at a time. On a typical server configuration, standard PHP memory limit, WordPress memory limits and browser capacity, 500 is usually ok. If you are adding more than this, do not to use the Manual Input function, and if using the CSV/TXT or Email List options, always use the 'Skip Form and Add Users' function instead of the 'Create User Information Form' option.

If you are planning to add hundreds or even thousands of users at a time, open your wp-config.php file at the root level of your WordPress install directory. Find the line where it says

/* That's all, stop editing! Happy blogging. */

Directly above that, add this code:

set_time_limit(0);

This will prevent WordPress from cancelling the adding function after the default 30 seconds. In the case of adding many users, it may take several minutes for the function to finish. Usually this is about 30 seconds per 500 users, but it varies on your specific server configurations.

You may also wish to try disabling New User Notification Emails in the Settings before adding a very high number of users, as the mail function can consume a lot of memory when used in bulk. If you can do without it, give it a try.

KNOWN ISSUE: New User Notification Emails Don't Send

This is an error that has only been reported a couple of times over the lifespan of the plugin. I have no fix for this unfortunately, as I simply cannot reproduce the error. In version 1.3.0 the wp_mail function was replaced with a standard php mail function to speed up the process and potentially eliminate any errors with the wp_mail function.

If you experience this error, firstly check that:

If that has no effect, consider one of these options:

If you're into PHP, do feel free to poke around the code and see if there's a flaw in the logic that may be causing this error and let me know!

Information on New User Tools

Each tool provided in the Add Multiple Users plugin for bulk adding users has additional information at the bottom of the page. I recommend you read the information provided with each tool, especially in regards to CSV data formatting and using the column reordering functions. All information contained within the plugin is also provided below.

Information on Settings

General Options

Send each new user a registration notification email?
If selected, automatically sends an email to each new registered user with the information provided in the Customise New User Notification Email settings. Users who have been added with a "forced" email address will not be emailed.

Send me a complete list of new user account details:
Highly recommended. When you submit the multiple registration form, the results of your registration will display on the screen. However, this information will not remain on the screen once you navigate away from the page or submit the form again. This option emails all this information to your registered WordPress user account email.

Validate entered email addresses:
This setting affects both the in-page validation and the on-submit validation. It uses WordPress "is_email" verification. If you have trouble entering email addresses that you believe are valid, disable this option.

Sanitize usernames using Strict method:
Determines whether usernames are sanitized with Strict method or not. Enabling this option disallows the use of many symbols that may be used in usernames normally. Affects both the on-screen validation and the on-submit validation. Get more info on user sanitization.

Force Fill empty email addresses:
Highly NOT recommended. This setting ignores empty email address fields that would normally cause that new user's registration to fail by creating a fake email address such as "temp_username@temp_username.fake". It is very much recommended that all new users have a valid email address, and this function should only be used in cases where you need to register new users that do not have active email accounts.

Ignore individual User Role settings and set all new users to this role:
Overrides any individual Role you select for each new and sets them to the role you choose here.

Customise New User Notification Email

From/Reply Address:
By default, new users will see the From/Reply email address in their New User Notification email as the email address of the administrator that added them. You can change this email address by adding a different address here, such as a "no reply" email address. You may also use this email address in the email message using the [fromreply] shortcode.

Site Login URL:
If you want to direct new users to a specific web address to log in, add the full URL here (including the http://). You may then add this to your email message using the [siteloginurl] shortcode. By default this setting is your main site URL.

Email Subject:
This is your email subject line and can include any of the shortcodes to add additional information to the subject line.

Email Message:
This is your main email content and must be written in HTML format using valid HTML tags (such as p and h1). Any HTML tag that can be understood by an email program can be used here. If you're not familiar with HTML markup, its probably best to stick to the default message, or you can play with it and use the Send Test Email button to send yourself an example notification email so you can check its formatting and content.

Shortcodes:
The shortcodes [sitename] [siteurl] [siteloginurl] [username] [password] [useremail] [fromreply] can be used in the Email Subject and Email Message fields to add specific data to your user notification email. For example, if you want to add that specific user's password to the email, using the [password] shortcode will add the users newly created password in there. Use these shortcodes to structure your email body text as you require.

Send Test Email:
Only available with Javascript enabled. This sends an example New User Notification Email to your email address using the information you currently have in the settings fields. Note that this does not save your Settings - you must still click the Save Options button to save your changes. This allows you to view the data and layout of the email that newly registered users will get when they are added to the site.

Information on form fields and settings

Usernames:
All new users must be given a unique username. Rows without a username are automatically skipped during the multiple registration process. Usernames cannot be changed once set. Usernames are automatically sanitized to strip out unsafe characters, but are not strictly sanitized.

Password:
May be set for each user, or left blank to generate a random password for that user. For more information on password strength and security, please visit the Hardening Wordpress page.

Email:
An unique, valid email address for each user is required (or use Force Fill option if emails are not available, see below). Emails will be checked for uniqueness and, if selected, validity.

FirstName, LastName, Website:
These parameters per user are optional and will be left blank if not filled in. Users or Administrators may update this information using the regular Wordpress user profile settings later. These fields are not validated.

Information on Uploading CSV and Text Files

Please choose either a .csv or .txt file to upload. All other file types are disallowed.

Recommended CSV Column Order

The plugin translates each line of your CSV (comma-separated values) data into seven variables: username, password, email, role, firstname, lastname and website, specifically in that order.

The best way to ensure your file is read properly is to structure your CSV data in this way if possible, separated by commas, using empty values in place of data you do not want to add. If you can export your CSV data in this format for upload here it will make importing your data quick and painless. If not, you can use the Customize function to specify your own line order.

Good Example 1: username,password,email,role,firstname,lastname,website - in this example the file is structured properly with all values added.

Good Example 2: username,,email,,firstname,lastname,website - in this example the "password" and "role" have been left blank, but the empty values are placed in the right order so the file will be read properly.

Bad Example 1: username,password,email,firstname,lastname,website - this example omits the "role" value and will translate incorrectly.

Bad Example 2: username,password,email,role,lastname,firstname,website - this example has the first and last name in the wrong order and will translate incorrectly.

How to use the Custom Column Order function

Check the Customise Column Order box to enable custom ordering.

The Custom Order function allows you to define how your CSV data is structured per line so that it can be read correctly by the plugin. By default, the order of CSV values is: username, password, email, role, firstname, lastname, website.

Setting a custom order

The order you set in the Custom Order section should match exactly the order of your CSV data structure per line.

If your CSV data takes a different structure than the default, and maybe has additional data not required to be used for new registrations, for example:

email, state, username, role, lastname, firstname, phone, age

you can set the Custom Order appropriate to how the data should be read (left to right), using the "ignore" option to tell the program to skip a redundant data column. In this case, you would set up the Custom Column drop-boxes in this order:

email, ignore, username, role, lastname, firstname, ignore, ignore

Column actions

Each column in the Custom Order box also contains buttons for reordering, adding and deleting columns:

Information about the Email List function

This function takes a normal list of email addresses and converts them into new user information.

Note: Users are not immediately registered on the site when you click the Create User Information button. The email addresses you provide here will be used to create a form containing user information that you can review before registering these users on your site, allowing you to find errors and add additional information for each user if desired.

Adding your email list

When adding email addresses to the field above, each address must be separated by a comma (,) character. Even if you put the next address on the next line, there should be a comma between each email address.

Note: All blank spaces are stripped from the email list (meaning spaces after commas are not necessary or detrimental, however email addresses that contain spaces will be compressed).

Information about Adding Existing Users

On this page you will see a list of users taken from your Network list who are NOT already a part of this site. Firstly, set the two options as desired above the user list. You may then check the users you wish to add to this site and click the Add All Users button.

Options for Adding Existing Users

Ignore individual roles and set all selected users to this role:
You can assign each existing user you add to this site an individual Role within this site. Make a selection here if you want to add all existing users you choose with the Role defined here instead.

Send each user a confimation email:
If you leave this unchecked, users you select will be automatically added to this site. Check this option if you do not want this to happen. Instead, each user you select will be sent an email asking them to confirm their adding to this site. When they have confirmed, they will show up in the Users list for this site.

For Future Development

Questions or Comments

I go by the handle happynuclear on the Wordpress website - come stalk me if you wish.