The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress create users by code Re: WordPress create users by code


If your adding users from a loop you can probably just create a file at root of WP and include wp-blog-header.php.

Something like this should work.

require 'wp-blog-header.php';

$users = array(); // this is where you would supply all of your users

foreach( $users as $user )
wp_create_user($user->username, $user->password);

You may need to create the script on a local version of WP to fix any bugs before you put it into production. And I would suggest deleting the file when your done with it.