• Total different taxonomies terms in system – 13000. I`m updating 150 terms in cycle.

    foreach ( $region_city as $region => $city ){
    $args = [
    ‘slug’ => sanitize_title($city),
    ‘parent’=> $region_term_id,
    ];
    wp_update_term( $city_term_id, ‘location’, $args );
    }

    Single wp_update_term execution is up to one second. But cycle is taking over 10 minutes.

    When I`m trying to break cycle in few steps the feeling is each next wp_update_term execution time is increasing.

    What can be possible reason? Is there some cache for this function or $wpdb?
    May be there is accumulation of data in function hooks/filters?

    ps. This script was perfectly working before. Recent changes on server is php upgrade 5.6 > 7.3 . Opcache is enabled.

    PS. Looks like this function has same issue: wp_update_user

  • The topic ‘wp_update_term running for long time after migration to php7.3’ is closed to new replies.