Can I hide an admin?

Hello, I need to hide an admin user from the staff list.
I don’t like that he shows in /about section.

How could I do that?

I suppose if you wanted, you could just target the div for that admin on the /about page and set it to display:none in your admin/customize CSS. It seems to work on meta using Chrome’s inspector, at least.

I’ll admit I’m a bit curious as to why you want a secret admin, though.

In this case, I’ve got an investor that want to “see” how this site is going, but now he want to “disappear” :slight_smile:

I’m thinking in change the username and put something like: “Secret admin” :lol:

About CSS, I don’t know how to set up that customization, sorry for my ignorance.

Regards!

Sorry, just went through and double checked with an actual customization, I don’t think applying a CSS rule will be enough since the div ids are, I guess, generated by ember, and are in any case not constant. Maybe there’s something you can do with javascript? Would have to ask someone else though, unfortunately.

What I get for writing out a quick solution without paying enough attention. :smile:

I don’t know that there’s a setting for what you’re looking for, renaming the user to something innocuous would at least be the easiest thing to do.

1 Like

If you’re self-hosted, this is possible with a plugin.

# plugin header here

module HideAdminNames
  NAMES_TO_HIDE = %w(investordude blahblahblah).freeze
end

after_initialize do
  class About
    def admins
      @admins ||= User.where(admin: true)
                      .where.not(id: Discourse::SYSTEM_USER_ID)
                      .where.not(username_lower: HideAdminNames::NAMES_TO_HIDE)
                      .order(:username_lower)
    end
  end
end
4 Likes

The div that wraps around each admin’s information now has a data-attribute that matches their username. So you can use

.about.admins [data-username="USERNAME"] {
  display: none;
}

to hide specific admins in that list - swap USERNAME with the username of the admin you want to hide.

16 Likes