Title: Adding new field to write/edit
Last modified: August 18, 2016

---

# Adding new field to write/edit

 *  Resolved [charismabiz](https://wordpress.org/support/users/charismabiz/)
 * (@charismabiz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/)
 * How would I add a field in the Write/Manage posts page to add a custom column?
 * I can add it in manually by editing post-new.php and post.php, but was wondering
   if there’s a way to do it via plugins.
 * Mainly involving the code. Database-wise, it’s easy to add a new column to wp_posts
   table.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 1 month ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561082)
 * a) You should not be adding new columns to the posts table. You should use custom
   fields instead, using the *_post_meta() functions. Or you should create your 
   own table. Modifying core table is just as bad as modifying core code: it makes
   it impossible to upgrade easily for that blog later.
 * b) There are action hooks all over the editing code for you to hook into. simple_edit_form,
   edit_form_advanced, edit_page_form. You’ll also need to use hooks to receive 
   and save the incoming form data: publish_post, edit_post, save_post, wp_insert_post,
   delete_post, etc.
 *  Thread Starter [charismabiz](https://wordpress.org/support/users/charismabiz/)
 * (@charismabiz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561085)
 * Thanks for the first part, new table it is.
 * As for the second part, I’ll look into it. Are the editing hooks the same as 
   for post creation, or are they just for editing?
 * And can you tell me (or link me to) more information regarding post_meta?
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 1 month ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561097)
 * There’s not a lot of good documentation on those, though the functions are fairly
   obvious and easy to use.
 * Look for these functions in the source code:
    add_post_meta delete_post_meta 
   get_post_meta update_post_meta
 * And examine them. They are fairly obvious. Basically you can add key->value pairs
   to any post and be able to pull it back later.
 * As for the editing hooks, I’m not entirely certain. You may just want to search
   through the source and find them to see where they are and what they do.
 * The best documentation on WordPress is WordPress itself. Whenever I want to know,
   I just go read the source code.
 *  Thread Starter [charismabiz](https://wordpress.org/support/users/charismabiz/)
 * (@charismabiz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561106)
 * I just found a section on the post create/edit pages where you can add custom
   fields
 * May still need those hooks to make the section more informative (eg: specifying
   a required specific field).
 *  [d9r](https://wordpress.org/support/users/d9r/)
 * (@d9r)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561388)
 * > a) You should not be adding new columns to the posts table. You should use 
   > custom fields instead, using the *_post_meta() functions. Or you should create
   > your own table. Modifying core table is just as bad as modifying core code:
   > it makes it impossible to upgrade easily for that blog later.
   > b) There are action hooks all over the editing code for you to hook into. simple_edit_form,
   > edit_form_advanced, edit_page_form. You’ll also need to use hooks to receive
   > and save the incoming form data: publish_post, edit_post, save_post, wp_insert_post,
   > delete_post, etc.
 * It would help if the documentation explained this better.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Adding new field to write/edit’ is closed to new replies.

## Tags

 * [action](https://wordpress.org/support/topic-tag/action/)
 * [api](https://wordpress.org/support/topic-tag/api/)
 * [development](https://wordpress.org/support/topic-tag/development/)
 * [edit](https://wordpress.org/support/topic-tag/edit/)

 * 5 replies
 * 3 participants
 * Last reply from: [d9r](https://wordpress.org/support/users/d9r/)
 * Last activity: [18 years, 3 months ago](https://wordpress.org/support/topic/adding-new-field-to-writeedit/#post-561388)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
