You can’t insert multiple rows via wpdb’s insert
, you have to do it with raw SQL:
INSERT into $meta_table (post_id, meta_key, meta_value)
VALUES
('val1', 'val2', 'val3'),
('otherval1', 'otherval2', 'otherval3')
However-
You should always use the API where a function exists- use add_post_meta
so your plugin integrates with the WordPress environment and its behavior can be modified without having to edit the plugin’s files directly.