Inserting serialized value into wp_postmeta using update_post_meta
Wow okay, so after posting this I almost immediately came up with the solution. It was a combination of the two things I tried. $defaultquantityarray = array( ‘quantity’ => ‘2’ ); update_post_meta( $post_id, ‘_default_attributes’, $defaultquantityarray); Apparently WordPress automatically serializes data in some meta_values, and I was essentially serializing them twice hence the s:29: prefix.