Using WordPress ‘list_authors()’ PHP function

The list_authors() WordPress PHP function is used to display a list of authors on a WordPress site.

Usage

list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '');

Parameters

  • $optioncount (bool) – Optional. Default: false. Show the number of posts by each author.
  • $exclude_admin (bool) – Optional. Default: true. Exclude the admin user from the list.
  • $show_fullname (bool) – Optional. Default: false. Display the full name of authors instead of just the display name.
  • $hide_empty (bool) – Optional. Default: true. Hide authors without any published posts.
  • $feed (string) – Optional. Default: ”. Add a feed link for each author.
  • $feed_image (string) – Optional. Default: ”. Display a feed image instead of a text link.

More information

See WordPress Developer Resources: list_authors()

Examples

Display authors with post count

To display a list of authors including the number of posts they have written:

list_authors(true);

Include admin in author list

To display a list of authors including the admin user:

list_authors(false, false);

Show full names of authors

To display a list of authors with their full names instead of display names:

list_authors(false, true, true);

Show all authors, even without posts

To display a list of all authors, even those without any published posts:

list_authors(false, true, false, false);

To display a list of authors with a feed link for each author’s posts:

list_authors(false, true, false, true, 'rss');