Hide admin user from user-directory and top contributors

Confirmed both set to “Everyone” causes /u?exclude_groups=admins to be honored.

But then also allows /g/admins to be assessed by those not logged in.

Thanks. I will revert for now.

It seems to work fine on my forum:

The group setup:

Logged in as admin

The default user directory with my admin profile first:

The filtered directory without the admin group, so my admin user is missing

Then I logged out:

(sorry that’s why it’s German now)
The default directory with everyone

And the filtered directory without my admin user

So basically the solution is to expose admins group, in order to hide (exclude) it.

Yes - you expose information about who is in that group, allowing you to use that data to hide its members at other places. Without knowing who you want to hide you cannot hide anyone.

Where exactly do I see that he is admin on that screenshot? I can spot a flair that indicates he is a member of the team group. But the team group is not the admin group. The team group is visible for logged out users. So I don’t get which hidden information you spotted.

“Team” is what’s listed on https://meta.discourse.org/g/admins

Again my issue isn’t about any of that. Was able to at least remove admin user from off the homepage’s Right Sidebar Blocks plugin with just CSS.

  .top-contributors--user:has([data-user-card="admin_username"]) {
    display: none;
  }

Hopefully this helps someone else.

Again it was not about security; it’s about being always ranked #1 in the list which yes also reveals on many forums who the admins are.

Will look into Discourse Meta but from what was discussed above, this is just the core of how Discourse works. The only other option would be disable enable_user_directory. But that would kill the sidebar top contributors list also, which again was the priority.

The admin group you link to had 76 members. The team group, which the flair refers to (that’s why you see ‘team’ on hover) has 79 https://meta.discourse.org/g/team. These are not the same.

Yes, but not to beat a dead horse one can sign up in 15 seconds and just visit: https://meta.discourse.org/g/admins

This might be true for the admin group. But as explained before, some forums might be invite-only, so you cannot do that, or the group’s visibility is limited even further. For example, only members of the group can see the group they belong to. Then only they can filter the directory for those members.

Ok so was able to achieve the result that I needed for both the front page side bar, but now also on /u with CSS again:

html.anon .top-contributors--user:has([data-user-card="admin_username"]),
html.anon .directory-table__row:has([data-username="admin_username"]) {
    display: none;
}

Hopefully this is useful for anyone else who just wants to exclude admins from showing at the top of the “likes received” ranking. Especially in less busy forums like mine.

As per title: “Hide admin user from user-directory and top contributors“… marking as solution.