Inserting Post Meta From SQL

Actually, the customary way to do this in WordPress would be to use <?php update_post_meta($post_id, $meta_key, $meta_value, $prev_value); ?> as per the codex: https://codex.wordpress.org/Function_Reference/update_post_meta. It yields shorter code, and the intent of the code is clearer.

Leave a Comment