wp_usermeta

Published: 3 Mar 2023

The wp_usermeta table is used to store additional details for each user besides those stored in the wp_users table. This can include information such as user preferences, biographical information, and other custom fields, often created and/or used by plugins or themes.

Each row corresponds to a single piece of meta data for a specific user, identified by the user_id value. The meta_key and meta_value columns store the key-value meta data pairs.

The table structure is similar to the other meta tables (wp_commentmeta, wp_postmeta, wp_termmeta).

Columns

umeta_id: Auto incrementing integer ID, used as primary key. It has no other meaning.

user_id: ID of the user to which the meta data belongs. It is the ID column from wp_users table.

meta_key: The key or name used to uniquely identify each piece of user meta data for given user. For example, if you wanted to store a user's first name, the meta_key might be "first_name".

meta_value: Actual value of the meta data piece. For example, if the meta_key is "first_name", the meta_value might be "John".

SQL Schema

CREATE TABLE `wp_usermeta` (
`umeta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL DEFAULT 0,
`meta_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_value` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`umeta_id`),
KEY `user_id` (`user_id`),
KEY `meta_key` (`meta_key`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

By remaining on this website or using its content, you confirm that you have read and agree with the Terms of Use Agreement.

We are not liable for any damages resulting from using this website. Any information may be inaccurate or incomplete. See full Limitation of Liability.

Content may include affiliate links, which means we may earn commission if you buy on the linked website. See full Affiliate and Referral Disclosure.

We use cookies and similar technology to improve user experience and analyze traffic. See full Cookie Policy.

See also Privacy Policy on how we collect and handle user data.

© 2024 WPDir