Custom hierachical taxonomy drop down is very slow

Support MB Custom Post Type Custom hierachical taxonomy drop down is very slow

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47038
    pixluserpixluser
    Participant

    Hello, I've have to say that editing a custom post, using a hierarchical custom taxonomy, is very slow, because the loading of the custom taxonomies items is very slow.

    First, it's very slow. I'm using +5000 taxonomies, and it take +10s on a private cloud server.
    I would like to know what is possible to do to reduce that loading time?

    Also it's not very not usable, because I'm using the hierarchical custom taxonomy for destinations. So first level of the root is continents, like ASIA, then country, like INDONESIA, then an island, like BALI. I can't see those active elements listed at the top of the windows : they are lost into the big list. So I need to search for them to see if they are active on this post or no… So it's very bad for ergonomic.
    Is it possible for you to plan to make it a little more usable?

    #47039
    pixluserpixluser
    Participant

    I'm using a checkbox tree interface.

    #47040
    pixluserpixluser
    Participant

    I've found a nice trick to add in functions.php
    Before the loading was at least 10sec for around 5000 taxonomies items. Now it's 1-2sec.

    destination is my taxonomy slug:

    add_filter('rest_destination_query', function ($prepared_args, $request) {
    if (strpos($request->get_route(), '/wp/v2/') === 0) {
    if ($prepared_args['number'] === 100) {
    $prepared_args['number'] = 100000;
    }
    }
    return $prepared_args;
    }, 10, 2);

    Can be very nice to have it loaded by default when using a custom taxonomy!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.