• Situation:

    • Clean wordpress install
    • No plugins
    • VPS server 5.2ghz / 4gb RAM (Default Directadmin)
    • Import of 10k users

    Problem:

    • WP-Admin edit.php and post.php take >4sec to load.
    • A custom post type without the ‘Author’ support loads quickly

    What I tried:

    Question:

    • What to do to get it fast again?
Viewing 1 replies (of 1 total)
  • Thread Starter Protozoan

    (@protozoan)

    Solved.

    Had a custom author drop down function that causes a large query loop.

    add_filter('wp_dropdown_users', 'cust_dropdown_users');
    function cust_dropdown_users($output)
    {
        $users = get_users();
    
        $output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">";
    
        //Leave the admin in the list
        $output .= "<option value=\"1\">Admin</option>";
        foreach ($users as $user) {
            $sel = ($GLOBALS['post']->post_author == $user->ID) ? "selected='selected'" : '';
            $output .= '<option value="' . $user->ID . '"' . $sel . '>' . $user->user_login . ' (' . $user->user_email . ')</option>';
        }
        $output .= "</select>";
    
        return $output;
    }

    Now trying to find a better way to select different authors (feel free to suggest!).

Viewing 1 replies (of 1 total)

The topic ‘WP-Admin edit.php & post.php slowdown after import of 10k users’ is closed to new replies.