idazuwaika
idazuwaika

Reputation: 3019

Script to Add User to Wordpress

I need help to quickly add about >100 username and password to a locally installed Wordpress.

I have a list of usernames in text file, and I'd let each password to be equal to username (or someother function if equal is not allowed by Wordpress).

Is there a way I can programmatically add users to Wordpress? I have access to wordpress database if that helps.

Thanks.

Upvotes: 0

Views: 4099

Answers (2)

st4ck0v3rfl0w
st4ck0v3rfl0w

Reputation: 6755

If you don't want to use a plugin and you have your users and passwords stored in an array, simply throw it into a loop and use the 'wp_create_user' function. It takes 3 parameters (username, password and email). It will return the ID if successful and false if not.

http://codex.wordpress.org/Function_Reference/wp_create_user

Upvotes: 1

brendan
brendan

Reputation: 29976

Check out this plugin, it will let you import users from a csv which is basically what you're looking to do:

http://www.dagondesign.com/articles/import-users-plugin-for-wordpress/

Upvotes: 1

Related Questions