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.

2 Answers 2

12

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.

0
8

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.

1
  • 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
    Commented Oct 7, 2015 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.