8

From my understanding, the wp_postmeta extends the schema for wp_post. So basically the standard fields/structure for a post will be found in wp_posts, and if any post(s) needed their own set of fields/attributes etc, they would be defined in wp_postmeta table. So I wanted to know if I'm right about this or not?

thanks.

Geert Bellekens
  • 12,788
  • 2
  • 23
  • 50
dave
  • 14,991
  • 26
  • 76
  • 110

2 Answers2

11

You are absolutely right. If there exist some meta box or "own set of fields/attributes" wp_postmeta table will store those field's values.

7

Have a look at this: https://codex.wordpress.org/images/2/2a/WP3.9.4-ERD.png

wp_postmeta (similar to wp_usermeta for users and wp_commentmenta for comments) stores any additional information which is connected to a post somehow especially user-defined.

Use the functions

add_post_meta()
update_post_meta()
get_post_meta()

which are already implementing object and array serialization/deserialization (and a lot of more) in order to store custom information which is not stored within the wp_posts table.

Blackbam
  • 17,496
  • 26
  • 97
  • 150
  • 2
    If i wanted to have a look at something i would've done so beforehand and noted it in my question. This is a Q&A website, please follow the rules at the bare minimum. Ty nonetheless. – dave Oct 07 '15 at 03:18