Authors Widget
Alter authors query to improve slow lookup on blogs with many users. (3 posts)

  1. aaronerk
    Posted 4 years ago #

    For blogs with lots of users (10,000+), your queries to lookup authors and author post counts take a really long time. I'm not sure how backwards compatible the below code snippet is, but it dramatically speeds up the plugin if you can use it.

    $user_args = array(
    'fields' => array('ID', 'user_nicename'),
    'who' => 'authors'
    $wp_user_search = new WP_User_Query($user_args);
    $authors = $wp_user_search->get_results();
    $author_ids = array();
    foreach($authors as $author) {
    $author_ids[] = $author->ID;
    $author_count = count_many_users_posts($author_ids);


  2. WebEndev
    Posted 3 years ago #

    Has this been resolved?

    I'm seeing some performance issues also.

  3. aaronerk
    Posted 3 years ago #

    No idea. My issue was solved by hacking at the DB query. Never looked to see if the plugin changed the way it does things.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Authors Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic