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
i am using wp 3.2v. i have to create multiple users and generate passwords and use empty email as the default email for the users(if possibe)
i know i have to use
but where exactly(in which file) should i use this code
and also i want to handle the empty email exception with
define ('WP_IMPORTING', true);
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.
$users = array(); // this is where you would supply all of your users
foreach( $users as $user )
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.