• BERJAYAGeorge

    (@subscriptiongroup)


    We have a website with millions of users. When running the importer, the second step, where we need to pick the author, the page becomes huge.

    That’s because the plugin is trying to load millions of records on the drop-down, something that creates a ridiculously large HTML page. This makes the browser and even the computer slow or unresponsive while trying to render the page.

    The plugin should instead use select2 or a similar solution where you have to start typing before the results appear.

Viewing 1 replies (of 1 total)
  • Thread Starter BERJAYAGeorge

    (@subscriptiongroup)

    In case it helps anyone until (if) this gets fixed, you can limit the records returned by the drop-down with the following filter that returns just users of a specific role.

    <?php
    /**
    * Force the WordPress Importer author dropdown to only load Editors.
    * This runs only on the Importer screen to avoid affecting other areas.
    */
    add_filter( 'wp_dropdown_users_args', function( $args, $parsed_args ) {
    // Only on the Importer screen & only for the WordPress importer.
    if ( is_admin()
    && isset( $_GET['import'] ) && $_GET['import'] === 'wordpress' // Tools → Import → WordPress
    ) {
    // Hard-limit to the Editor role.
    $args['role'] = 'editor';
    // (Optional) keep UI snappy:
    $args['orderby'] = 'display_name';
    $args['order'] = 'ASC';
    $args['number'] = 500; // safety cap; increase if needed
    }
    return $args;
    }, 10, 2 );
Viewing 1 replies (of 1 total)

The topic ‘Plugin slow/crashing on large sites’ is closed to new replies.