Title: add_post_meta without serializing the array?
Last modified: August 20, 2016

---

# add_post_meta without serializing the array?

 *  [Felix](https://wordpress.org/support/users/ltse/)
 * (@ltse)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/add_post_meta-without-serializing-the-array/)
 * I’m trying to use **add_post_meta** to submit a multidimensional array.
 *     ```
       array( array (
       "key1" => "value1", "key2" => "value2", "key3" => "value3"
       ) )
       ```
   
 * However, this serializes the array into a string, which I don’t want because 
   I’m using this data with a plugin.
 * When I use **update_post_meta** with the same array, it works perfectly, however
   I’ll only be able to submit one set of values this way.
 * Is there any possible way to use add_post_meta without serializing the array?

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/add_post_meta-without-serializing-the-array/#post-3568464)
 * I’m not sure what’s going on here, all array and object data is serialized by
   both functions, whether you like it or not. But when you get_post_meta(), the
   data is unserialized back into an array or object, so it shouldn’t make any difference
   to your plugin how it is actually stored, you should get back what you put into
   it.
 * I can only imagine data somehow is being serialized twice, but only unserialized
   once.

Viewing 1 replies (of 1 total)

The topic ‘add_post_meta without serializing the array?’ is closed to new replies.

## Tags

 * [add_post_meta](https://wordpress.org/support/topic-tag/add_post_meta/)
 * [array](https://wordpress.org/support/topic-tag/array/)
 * [multidimensional](https://wordpress.org/support/topic-tag/multidimensional/)
 * [update_post_meta](https://wordpress.org/support/topic-tag/update_post_meta/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/add_post_meta-without-serializing-the-array/#post-3568464)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
