I’m researching the structure of WordPress database and there is something that really get me confuesd.
Could someone please explain, what is the exact job of meta_key
and meta_value
fields in wp_commentmeta
, wp_postmeta
, wp_usermeta
tables? What is the job of these tables anyway?
I did read the Database Description in the Codex, but still don’t get it.
Think of them as array key/value pairs (kinda). These tables are used to store additional data about particular posts, comments, or users. The
meta_key
is the name by which themeta_value
is retrieved, plus you have associations with particular posts, comments, or users by means of IDs. As far as structure goes, that is about it. These are “extra info” tables. You can even add to them via the backend.*_postmeta
is where the custom fields are stored.WordPress stores, and plugins and themes can store, a wide variety or information there. Some of those tables have critical information, like role/capability data, but you may also have relatively trivial data like someone’s Jabber handle (Is that even around anymore?), or a favorite color.