Title: Why is meta_key nullable?
Last modified: May 16, 2018

---

# Why is meta_key nullable?

 *  [Alex](https://wordpress.org/support/users/alexrsoap/)
 * (@alexrsoap)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/why-is-meta_key-nullable/)
 * In the wp_commentmeta, wp_postmeta and wp_usermeta tables, the meta_key column
   is set to be nullable by default.
    As a key-value store, surely null cannot be
   an acceptable key? It may only be a small overhead for small sites, but the query
   performance on large sites(>5gb db) from having this column not be null would
   definately be benificial. Is there any use cases where the key _would_ be null?
   Can you even read/write to a null key via conventional update post meta calls?
   If not, is there a process for creating a change request? I get meta_value being
   null, but not the key. Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [Alex](https://wordpress.org/support/users/alexrsoap/)
 * (@alexrsoap)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/why-is-meta_key-nullable/#post-10285934)
 * In regards to the above:
    [https://developer.wordpress.org/reference/functions/get_metadata/](https://developer.wordpress.org/reference/functions/get_metadata/)
   specifies that if null is passed for the meta_key, all meta for the object is
   returned, not one with a meta_key of null.
 * [https://codex.wordpress.org/Function_Reference/update_post_meta](https://codex.wordpress.org/Function_Reference/update_post_meta)
   has meta_key as a requred field

Viewing 1 replies (of 1 total)

The topic ‘Why is meta_key nullable?’ is closed to new replies.

## Tags

 * [postmeta](https://wordpress.org/support/topic-tag/postmeta/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Alex](https://wordpress.org/support/users/alexrsoap/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/why-is-meta_key-nullable/#post-10285934)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
