WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to have the authors listed like usual from wp_list_authors() but I know there are a couple of ones I would like to exclude from the list as well. Is there a way to do that?


share|improve this question
@Paul Sheldrake: Do you always want to exclude those users, or only in certain contexts? If only in certain contexts, which ones? – MikeSchinkel Oct 7 '10 at 17:58
Typically I would always want to exclude them. – Paul Sheldrake Oct 11 '10 at 20:59
up vote 3 down vote accepted

wp_list_authors() now does have an exclude parameter. So you can exclude the authors you want by their user ID.

It accepts:

An array, comma-, or space-separated list of author IDs to include. Default empty.


// exclude just the author with the ID 4
wp_list_authors([ 'exclude' => 4 ]);

// exclude the authors with the IDs 4 and 7
wp_list_authors([ 'exclude' => [ 4, 7 ] ]);

// or
wp_list_authors([ 'exclude' => '4, 7' ]);
share|improve this answer

It seems wp_list_authors does not have any filters, nor does get_users_of_blog, the function it uses to get the user list. So you either have to regex-and-replace the output yourself, or create a similar function with an extra parameter to specify authors to exclude. It's not too big, and most of the code is spent handling options, so it isn't that much duplication.

You could always vote for the existing Trac ticket to get an exclude parameter added in a future version!

share|improve this answer
Thanks for adding the Trac reference :-) – EAMann Oct 7 '10 at 15:19
@EAMann: Ah, you didn't have to delete your answer for this! – Jan Fabry Oct 7 '10 at 15:30
We were saying the same thing. No reason to duplicate what was already a good answer. – EAMann Oct 7 '10 at 15:50
@EAMann: But the rep man! Think of the rep! Oh, wait - a diamond next to your name. Nevermind. You're one of those. – Jan Fabry Oct 7 '10 at 15:57

I have used the following code to include info from Authors (WordPress users) in a page template. It could be reversed to exclude authors.

            //display selected users
            $userids_to_display = array(4,221,22,3,5,9,235,236,250); // wordpress user IDs to include
            $blogusers = get_users_of_blog();
            if ($blogusers) {
              foreach ($blogusers as $bloguser) {
                if ( in_array($bloguser->user_id, $userids_to_display) ) {
                  $user = get_userdata($bloguser->user_id);
                  echo '<div>';
                  echo '<div class="alignleft">'.get_avatar($user->ID).'</div>';
                  echo '<div class="user-data"><h3>' . $user->user_firstname . ' ' . $user->user_lastname . '</h3>';
                  echo '<div class="author-description">'.$user->description.'</div>';                
                  echo '</div>';
share|improve this answer

Since it seems there is no way to do this without a custom function, you could use jQuery to find their names and hide them after the list is generated. Something like this:

$('ul.author_list li:contains("John")').remove();

I also found a plugin that can do this for you: List Authors Plus

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.