Title: create_user
Published: April 25, 2014
Last modified: August 20, 2026

---

# create_user( string $username, string $password, string $email ): int

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#changelog)

This function has been deprecated since 2.0.0. Use [wp_create_user()](https://developer.wordpress.org/reference/functions/wp_create_user/)
instead.

An alias of [wp_create_user()](https://developer.wordpress.org/reference/functions/wp_create_user/).

## 󠀁[Description](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#see-also)󠁿

 * [wp_create_user()](https://developer.wordpress.org/reference/functions/wp_create_user/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#parameters)󠁿

 `$username`stringrequired

The user’s username.

`$password`stringrequired

The user’s password.

`$email`stringrequired

The user’s email.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#return)󠁿

 int The new user’s ID.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#source)󠁿

    ```php
    function create_user($username, $password, $email) {
    	_deprecated_function( __FUNCTION__, '2.0.0', 'wp_create_user()' );
    	return wp_create_user($username, $password, $email);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/deprecated.php#L1217)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/deprecated.php#L1217-L1220)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_create_user()](https://developer.wordpress.org/reference/functions/wp_create_user/)`wp-includes/user.php` |

Provides a simpler way of inserting a user into the database.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/create_user/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fround-lake.dustinice.workers.dev%3A443%2Fhttps%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fcreate_user%2F)
before being able to contribute a note or feedback.