Function: username_exists

username_exists( string $username )

Determines whether the given username exists.

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.


Name Type(s) Default Value Description
$username string



integer | false

The user's ID on success, and false on failure.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.