wp_commentmeta

Published: 3 Mar 2023

The table wp_commentmeta in WordPress database contains metadata for individual comments – mostly additional or optional bits of information, often created and used by plugins, that does not fit into the wp_comments table. Examples include various comment rating scores or status information.

Table structure is similar to the other meta tables (wp_postmeta, wp_termmeta, wp_usermeta).

Columns

meta_id: Unique identifier for each metadata row (auto incrementing integer id). It has no other meaning.

comment_id: The comment_ID from wp_comments table. It identifies the comment which the metadata belongs to. Note different capitalization in the two tables: The column name is comment_id here, but comment_ID in wp_comments.

meta_key: Name (label) of the metadata. Maximum length is 255 characters. One comment can have multiple metadata rows, even multiple rows with the same meta_key.

meta_value: Value of the metadata. Although usually it is also quite short, its length can theoretically be very long (longtext = 2^32 characters). Often the value represents a number (such as a status or rating code), but it is always stored as text in the database (e.g. '1').

SQL Schema

CREATE TABLE `wp_commentmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`comment_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 `comment_id` (`comment_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