Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.1   Updated Tuesday, June 12th, 2007 at 6:18pm

Import Users Plugin for WordPress

This plugin was created for people who need to easily add multiple users to their WordPress installation. Simply give it a list of usernames and email addresses, specify the role of the users (subscriber, author, admin, etc.) and it does the rest. It will automatically email each user and give them their randomly generated password. It also has validation in place to make sure the usernames do not already exist, that the email addresses are not already in use, that the usernames are valid, etc. After it processes the information, it tells you how many were added, and upon error, gives you the reason why each failed.

Download

  • Latest Release (For WordPress 2.0 through 2.5)
  • Modified Release (For WordPress 2.0 through 2.5)
    Contributer Nicholas LaRacuente has sent us this heavily modified version which adds support for file uploads, as well as arbitrary regex delimiters to ease importing from various sources. Thanks Nicholas!

Changelog

  • 06-12-07 - Modified version by Nicholas LaRacuente added (download link above).
  • 05-03-07 Version 1.1 - Updated to take advantage of the customizable roles feature in WordPress 2.1. This update was contributed by Tom Ransom.
  • 08-06-06 Version 1.0 - First release.

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory.
  • Enable the plugin.
  • Use it by going to ‘Manage -> DDImport Users’

Usage

The userdata is entered in the following format:

username|email
username|email
username|email
etc…

To clarify, that is one user per line, with a pipe character between the username and email address. Extra whitespace and empty lines are trimmed automatically. Be sure your data is entered properly!

After you have added your user data, you can choose the role for the users with the drop down box. The choices are: Subscriber (default), Contributor, Author, Editor, and Administrator.

  1. 48
    Stepsel

    Can this plugin be used in WP 2.5.n ?

  2. 47
    Minstrel

    I am trying to bulk upload around 5000 users. I have disabled the feature that sends the email as it is not required. The usernames, passwords and emails were added successfully but the passwords don't seem to work unless I reset them using the Wordpress Web interface.
    Is there a way to login to Wordpress without resetting the password?
    Would appreciate some help on this.
    

  3. 46
    Minstrel

    I am trying to bulk upload around 5000 users. I have disabled the feature that sends the email as it is not required. The usernames, passwords and emails were added successfully but the passwords don’t seem to work unless I reset them using the Wordpress Web interface.
    Is there a way to login to Wordpress without resetting the password?
    Would appreciate some help on this.

  4. Hi,

    Good plugin, any plans on adding a feature to edit and send a specific email to users imported?

  5. Hi

    Same problem as a few mentioned, the users are being added but in my tests no email was sent out. Any thoughts?

    Thanks,

    Ian

  6. Hmmm…
    I decided to use the modified version on a new site I am working on…the users are sent an email, but it is not generating passwords…
    Is this just a fluke in the modified version?
    Thanks

  7. 42
    James

    I have installed the plug-in and it doesn’t appear to be sending out an email notification. Individuals are appearing as users, however, none of them know it. Any suggestions on what may be causing this? I’m using the default delimiter and have tried multiple times.

  8. Fantastic work, I think you’ll save me a alot of time!! I’d really love to be a wp-plugin developer :-)

  9. 40
    Laarni

    great plugin. But i have a question though, for example i have a blog in a domain with more than 30 authors (they have posts, etc) if ever I’m going to change my domain, could I export those 30 authors and import them using this plugin? Currently, WP can import categories, posts, pages only, right? I tried importing my authors but i realized it can’t.

    Are you getting me though? hehehe.

  10. thank you for your plugin! i was searching a lot for this solution and hopefuly a found it!

  11. I modified your plugin to allow for the importing of both new and existing users in WordpressMU blogs. Great educational blog potential!

    Great plugin!

  12. 37
    gilliancs

    You might consider having the default level ’subscriber’ rather than ‘administrator’. 100 administrators could be worrisome!

    I’ve recommended your plugin to folks having problems sending new user registration emails. It works fine for me now. (see “registration emails” on the WP forum).

    Thanks for your work.

  13. This plugin is great. I have a blog and this thing ij very helpful

  14. Thank you for this plugin. The link to the modified Nicholas LaRacuente version above actually points to the original, unmodified script.

  15. 34
    jack

    Great plugin! Saved me tons of time. It should be standard built-in functionality for Wordpress mu.

    The only difficulty I ran into was that the plugin happily accepted and inserted mixed case name which WP login does not recognize. WP login makes submitted names lower case and checks the DB against that, and of course, then, it cannot find a match if the names were entered with mixed case. I think it should be simple fix. I may go ahead and make the necessary change in my version.

    But thanks anyhow for something very, very helpful.

  16. 33
    alias

    anyway to include a message with notification ?

    might be a good idea to help these added users to know why they are receiving a username/password out of the blue, in my case old users or import from old mail, etc there’s good reason to include a notification message, also to make it distinct from the signup email which now they are both the same pretty much

  17. Fantastic mod - just saved me loads of work in uploading 100 subscribers for a new blog. THANK YOU!

  18. Tom: Nice work - I had not done much with this plugin since the release of 2.1, and I was not aware of that feature :) I will implement it and upload a new version. Thanks!

  19. Happy to provide a improvement -
    With 2.1, the names of the roles can change (and be added) - so rather than hard code the role names on the import screen, I have modified the code to request the list of available roles for the select at the bottom of the page.

    on line 28, add $wp_roles to the global
    global $wpdb, $wp_roles;

    at line 228, replace the hard-coded list of roles with

    
    		<?php
    			if ( !isset($wp_roles) ) 
    				$wp_roles = new WP_Roles();
    			foreach ($wp_roles->get_names() as $role=>$roleName) {
    			echo '<option value="'.$role.'">'.$roleName.'</option>';
    			}
    		?>
    

  20. Redownloading worked. No plugin conflicts (default setup for a testing site). Weird, but thanks!

  21. Kim: Not right at all :) Did you already try re-downloading the plugin file? If that did not help, maybe there is some sort of a conflict with another plugin?

  22. I saved the file as directed and uploaded it to my plugins folder. When I log in to the admin area and go to plugin management, I get the entire plugin code spread around the plugin admin table. I’m not sure what’s going on, but I know something’s not right.

    I’m using WP 2.1.2

  23. Ramon: Do you use WordPress 2.0 or newer?

  24. Im getting this error just when i click on “Import Users”:

    Fatal error: Call to undefined function: validate_username() in /home/labfis/public_html/blog/wp-content/plugins/dd-import-users.php on line 96

  25. Hei! I find the problem now: I use the Themed Login Plugin (http://www.jameskelly.org/wordpress-plugins/custom-login-and-registration-forms-plugin/) but it was not config. There was the wrong e-mail in.

    I´m sorry!
    Markus

  26. Markus: I am not sure about that one, since this particular plugin uses the functions built into WordPress to notify the users of the new account - it does not send the mail itself. There is surely a way, I have just not experimented with it. Is that the address you have setup under the admin account?

  27. Hei!

    How can i chance the sender-email-adress? the plugin use wordpress@gmail.com, but i will use another.

    Thank´s a lot!
    Markus

  28. andrabr: Good suggestions - thanks :)

  29. 20
    andrabr

    Works like a charm!

    I would suggest for the next version an option to choose the delimiter and maybe even to upload a file: a comma would allow people to import from excel, and a space delimiter would allow for basic copy/paste… Many a php virgin will thank you for that.

  30. Thomas Burg: This plugin actually uses the same functions WordPress uses when a new user registers. Which means the sender’s email address, and message are not defined in this plugin - they are set in the WP core files. They can most likely still be set, just not through the plugin itself. It calls the wp_new_user_notification function. Here is some info on where that function is defined, and where it is referenced: http://wordpress.taragana.net/_functions/wp_new_user_notification.html

  31. Hi, thanks for that great script!
    Thereare just two thinga:
    - how gets the senders email choosen? In my case it uses an non-existing email which is a problem in case of replies and I don#t know where to change that.
    - I’d like to edit the text that gets send.

    Appreciate your help.

    Thanks
    Thomas

  32. Thanks for all your help I’m using the Email Notification plug-in and it seems to handle the load well.

  33. Chris: There may be some info on the max number of WordPress users in the WordPress forum - I am not sure. And no, I have not used that plugin :)

  34. Admin,

    Thanks for the reply. Perhaps I’m overtaxing the capabilites of the system?

    Have you any experience with the Mailing-List plugin?

    Thanks,
    Chris

  35. Chris: That is a decent number of users :) Did the plugin appear to handle it properly? It might not hurt to take a look at the database just to be sure.

    I have no idea if WordPress can even properly handle that many - do you know for sure? :)

  36. I’m having a little difficulty. I’ve just imported 3500 users and now my users page doesn’t display. When I go to the Users tab and click on “Users & Authors” I get an error in IE and Firefox wants to download the file. Any suggestions?
    Thanks, great plugin.

  37. [...] Test import users plugin. DONE [...]

  38. [...] Wordpress: Iscrizione di massa Passare da un vecchio blog* alla piattaforma WordPress non è mai totalemnte indolore anche perchè se non esistono script per importare automaticamente i dati da vecchio blog* a WordPress sono dolori ed è quel che è capitato al sottoscritto. Situazione reale capitatami: Problema 1: …archivi, post, categorie? Importare archivi, categorie, porst, utenti, da vecchio a nuovo blog basato su WP: con qualche stratagemma tutto tranne gli utenti sono stati importati. Problema 2: …e gli user? Nel vecchi blog avevo quasi 400 utenti iscritti e non potevo assolutamente fare una cosa manuale, mi avrebbe portato via una giornata intera. Ecco che chi cerca trova: il plugin in questione è Dragon Design Import User ed in un colpo solo ed in 10 secondi ho importato quasi 400 utenti. Sia chiaro che poi ogni utente dovrà recuperarsi la password con il classico link "Ho dimenticato la password…" vistro che poi viene generata automaticamente Per la forza di WordPress * = il "vecchio blog" era basato su bBlog e lo script che ho usato per importare da bBlog a WP lo trovi al seguente link: http://www.shaolintiger.com/2006/07/…export-script/ (passate da bBlog a WP1.5 e poi aggiornate all’ ultima versione stabile quest’ ultimo se no non vi importa i nomi delle categorie __________________ >>> Segnala il tuo Feed su Aquileia Linux Project La tua recensione GEO taggata Pinguino di Linux e Open Source [...]

  39. Marcus: It sounds like some whitespace got added to the top of the file (before the PHP declaration). I would try re-downloading it the plugin.

  40. Ôªø
    Warning: Cannot modify header information - headers already sent by (output started at /home/vietwa/public_html/wp-content/plugins/dd-import-users.php:1) in /home/vietwa/public_html/wp-admin/plugins.php on line 16

    I got the above message when activate the plugin, and can’t seem to import anybody. Please help! Thanks.

  41. Natalie: I suppose it might be possible. The current version, as mentioned, just uses a lot of the built-in WP functions that it uses when new accounts are generated, and I do not recall off hand if you can specify a password in that manner. It just autogenerates one and emails it to the user.

    Gary: Good to hear!

  42. 7
    gary feng

    Thanks, Admin. I found out later that it’s a problem with my PHP setup. It’s working like a charm now. Thanks so much!

    – gary

  43. What a great idea! I would like to try this for a membership site I’m creating. We use a membership management software that bridges the registrations over to the discussion forums. I’d like to use this to import the user info into the WP front end. Is it possible to import the existing password as well so we have the same login info all across the board?
    Thanks again

  44. gary: To test, just try to log in using one of the accounts you created. To send the messages, it just uses the built-in functions that WordPress itself uses when a new account is registered. You could try to register an account manually and see if you receive the email, since it should send it the exact same way.

    For the record, it does not send out invitations per se, but rather confirmations that the accounts have been created.

    Also, you do not have to enable anon users.

  45. 4
    gary feng

    one more question — do you have to enable anomynous users to sign up in order to run this plug in?

  46. 3
    gary feng

    Hi, great work. I installed on WP2 with no problem. But I don’t think my invitations went out, even though it says successful. I invited myself on another email account but never got it. My question is — what email service does it use and how do I know the email is sent out? I don’t see anywhere to config an email server.

    Thanks!

  47. IBloon: This script is automatic. It does not redirect the admin anywhere. It just imports the users and assigns everything itself. Of course you could go in manually afterwards and adjust things. Some new code would have to be added to allow you to enter the ‘about me’ text, since user metadata is stored in a different location than the basic information.

  48. Hey, I have a question. Could this be modified to accept an about me paragraph? I havn’t tried it out yet but I am assuming from your description that after you do the whole “one person per line formatting” which gets their e-mail and sends them their password, it redirects the admin to a page that allows you to assign each new user their role. On that page how could I make it so that it also allowed me to edit each user’s about me paragraph? Thanks

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.