wp_postmeta

Published: 3 Mar 2023

The wp_postmeta table is used to store additional information related to posts, such as custom fields or post thumbnails. It is often used by plugins or themes.

Its structure is similar to the other meta tables (wp_commentmeta, wp_termmeta, wp_usermeta).

Columns

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

post_id: ID of the post the meta belongs to (the ID column from wp_posts table).

meta_key: Key of the meta data. This column is used to uniquely identify the meta data. Examples: "_thumbnail_id" or "meta_description".

meta_value: Value of the meta data, stored as serialized string. Example: "123" for the "_thumbnail_id" meta key.

SQL Schema

CREATE TABLE `wp_postmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`post_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 (`meta_id`),
KEY `post_id` (`post_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