Skip to content

Creating WordPress users in bulk

On one of the WordPress sites I maintain, I found myself needing to create about 50 users. With a quick search, I found the needed functions are wp_create_user and wp_new_user_notification.  However, the sample scripts did not work.  Either the required WordPress bootstrap file was incorrect, or needed a path, or the wrong arguments were passed.  So, for everyone’s benefit, here is my very simple script:


// repeat the following two lines for as many more users as needed.
$user_id = wp_create_user('username', 'ClearTextPassword', '');
wp_new_user_notification($user_id, 'ClearTextPassword');

The user will receive the standard announcement email. I used Excel to generate the needed lines and pasted them into the script.  Finally, I placed the script, named makenewusers.php, at the root of the site and pointed a browser at

Published inUncategorized