Support

Account

Home Forums General Issues Update_field for multiple Posts using one sql query Reply To: Update_field for multiple Posts using one sql query

  • I forgot to mention that the update_field() is taking so long because the programs repeater field has about 60 sub-fields, including another repeater “locations” inside of it.

    Maybe updating 300 (schools) * 60 (total fields) will just take this long? Was hoping for something sub 10 seconds, since 18000 updates seems like it shouldn’t take 60 seconds

    I’ve also tried several “wp_importing” tricks, none of which have decreased the time to import

    ex: set_time_limit(0);
    ignore_user_abort();
    wp_defer_term_counting( true );
    wp_defer_comment_counting( true );
    $wpdb->query(‘SET autocommit = 0;’);
    if (!defined(‘WP_IMPORTING’)) {
    define(‘WP_IMPORTING’, true);
    }
    $wpdb->query(‘ALTER TABLE wp_postmeta DISABLE KEYS;’);

    with appropriate cleanup after