ListUsers lists users of various groups in the wiki. Similar to ListAdmins, the list is generated via API, and thus does not require any modifications. However, the group can be manually adjusted. Any change in user rights would be automatically amended to the list.

code2.js adds the ability to include custom user group exclusion classes to the .listusers elements, allowing for the exclusion from the listing certain users who may also be members of other user groups.


Add the following to your wiki's MediaWiki:Common.js for site-wide use:

    type: 'script',
    articles: [
        // ...
        // ...


Any tag, with the class name listusers, and group name as the id would generate a list of users in that group. For instance:

Code Output
<div class="listusers" id="sysop"></div>
  • If the id, that is, the user group is not defined, a message will appear instead of the list: "No user group found".
  • If no users are found in a group (technically, that is not possible as An unknown anonymous user is always present for no users, which is apparently, a bug), another message will be displayed: "No users found in the <usergroup> group".


The list can be configured using the listUsers object.

Option Type Values Default Adds a talk link boolean true/false true
listUsers.contribs: Adds a contribs link boolean true/false false
listUsers.editcount: Adds the users actual editcount boolean true/false false
listUsers.limit: Number of results parsed (max. 500) number Any value between 1 - 500 10

The listUsers object also stores custom user groups, which can be added manually.

For instance, if you want the list to be displayed with talkpage and contributions links, your code would look like:

window.listUsers = {
    talk: true,
    contribs: true
importScriptPage('ListUsers/code.js', 'dev');

Other options will take the default values.

User groups

A full list of supported user groups, that can be used as valid ids, are (case-sensitive):

  • bot
  • sysop
  • bureaucrat
  • staff
  • vstf
  • helper
  • rollback
  • chatmoderator

Other groups listed in Special:ListUsers have been purposely struck down, but can be added manually if required.

Adding custom user groups

The script supports custom user groups as well. For adding custom user groups, store them in the listUsers.customgroups array. For instance:

window.listUsers.customgroups = ['codeeditor'];
importScriptPage('ListUsers/code.js', 'dev');

Excluding user groups

Users in additional user groups may be excluded through the addition of several custom classes:

class Exclude
LU-exclude-bot Bots
LU-exclude-bureaucrat Bureaucrats
LU-exclude-chatmoderator Chat Moderators
LU-exclude-content-moderator Content Moderators
LU-exclude-rollback Rollbacks
LU-exclude-staff Fandom Staff
LU-exclude-sysop Administrators
LU-exclude-threadmoderator Discussion Moderators

To-do list

  • Allows the use of .listusers#active, which would list all users active in the last 30 days
    • Implicitly depends upon ListUsers.limit


September 9, 2014
Script published.
October 16, 2017
Rewrite, addition of exclusion classes, +i18n
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+