Wordpress - Safe to delete blank postmeta?
You should be fine deleting empty custom fields.
The main reason is, that get_post_meta( $id, 'metakey', true )
returns an empty string if the field is not set, so it is the same as having an empty record set.
get_post_meta( $id, 'metakey', false )
, returns an empty array if no value is set, so you should be fine too.
The only problem you could face is with getting all metadata at once (get_post_meta( $id )
), because in the return to this call the empty values are set, but they are not set, if there is no record in the database. This could cause a few PHP_WARNING
s, but you should be okay.