The wp_users
table stores information about registered users. For each user, it contains essential data such as username (login), email, password, display name, status, and other details. Additional information can be stored in the wp_usermeta
table.
Columns
ID
: Integer user ID, which uniquely identifies each user. It is also referenced in other tables, such as wp_posts
(posts made by the user), wp_comments
(comments made by the user), and wp_usermeta
.
user_login
: Username which the user uses to log in to their account. For example, if the user's name is John Smith, their user_login
might be "jsmith". Usernames must be unique and cannot be changed once set.
user_pass
: The user's encrypted password. WordPress uses the MD5 hashing algorithm to encrypt passwords for security.
user_nicename
: A "nice" version of the username. It is usually the same as user_login
, but can also contain spaces or special characters.
user_email
: The email address associated with the user's account. It is used for password resets and other communication with the user.
user_url
: The user's website URL, if they have one. It is optional.
user_registered
: The date and time when the user registered.
user_activation_key
: Unique activation key that is sent to the user's email address when they first register. The key is used to activate the account.
user_status
: Integer status code of the user's account. Possible values are 0 for inactive, 1 for active, and 2 for blocked.
display_name
: The name that is displayed publicly on the website. It can be the same as username or it can also contain uppercase lettes, spaces, and special characters. For example, if the user's real name is John Smith, their display_name might be "John S" or "Johnny".
SQL Schema
CREATE TABLE `wp_users` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_login` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_pass` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_nicename` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_url` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`user_activation_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`user_status` int(11) NOT NULL DEFAULT 0,
`display_name` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`ID`),
KEY `user_login_key` (`user_login`),
KEY `user_nicename` (`user_nicename`),
KEY `user_email` (`user_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;