Hi there is there a way to insert multiple metas in one function instead of using update_meta ?

I have to import 3000 products in 10 min so optimisation needs to be done...

  • best optimization is to not to have unrealistic expectations in the first place. This will be hard to do without bringing down the server or creating unstable states. Your only possible optimization is to find a way in which you do not have to import that much data (decide which data can be skipped). – Mark Kaplun Aug 29 '17 at 12:07

If you "Import" Products, i assume you use the wp_insert_post function?

In that case, you can use the meta_input argument like this:

$args['meta_input'] = array(
                         'meta_key_1' => 'meta_value_1',
                         'meta_key_2' => 'meta_key_2',

Other than that, if you know EXACTLY what you're doing, you could look into inserting the data directly by using the wpdb Class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.