wp_termmeta

Published: 3 Mar 2023

The wp_postmeta table is used to store additional information about WordPress terms (categories, tags, and custom taxonomies) besides those in wp_terms and wp_term_taxonomy tables.

For example, if a travel website has categories or custom taxonomies for different travel destinations, wp_termmeta table can store information such as GPS coordinates, airport codes, or local currency codes.

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

Columns

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

term_id: The ID of the term (category, tag, or custom taxonomy) associated with the metadata. It is the term_id column from wp_terms table.

meta_key: The name of the metadata key. Example: "gps", "airport_code", "currency".

meta_value: The value of the metadata associated with the term, stored as serialized string. Example: "50.07,14.43" for the "gps" meta key or "PRG" for the "airport_code" meta key.

SQL Schema

CREATE TABLE `wp_termmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term_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 `term_id` (`term_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