Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wpmu create user


Create a user using strict username sanitization: only alphanumeric, _, ., -, and/or @ are allowed.

This function runs when a user self-registers as well as when a Super Admin creates a new user. Hook to 'wpmu_new_user' for events that should affect all new users, but only on Multisite (otherwise use 'user_register').


<?php wpmu_create_user$user_name$password$email ); ?>


(string) (required) The new user's login name.
Default: None
(string) (required) The new user's password.
Default: None
(string) (required) The new user's email address.
Default: None

Return Values

Returns false on failure, or int $user_id on success

Source File

wpmu_create_user() is located in wp-includes/ms-functions.php