Hide User Profiles setting incomplete

The 'Hide User Profiles from Public’ option is a great feature for hiding user details, particularly their Display name, from anonymous users, but it is incomplete.

Even when this feature is enabled, the lists in the Users, Groups and Badges directories (available to all visitors via the Hamburger menu) still show the user’s Display Name. Why are these not hidden here as well?

My use case is:

  • site can be browsed by public
  • users’ details are private (so cards only load for logged-in members)
  • the site offers a list of groups and badges, without revealing private information

This could be achieved by removing the Display Name from the fields shown on these lists, or by removing the Directory aspect of these pages and leaving only the list of Badges or Groups with their descriptions, but not who belongs to them, for all Anonymous users.

Am I missing something? Is there a way to achieve this?

https://github.com/discourse/discourse/commit/bb79e6aff7acd95d1dac8fcf367978af2ad81162

Example of page where Hide Profiles is enabled, and visitor is not logged in, but names are displayed:

1 Like

What is the value of the enable names site setting?

Do you mean the value of hiding them?

We have a membership organisation where we would have wanted to insist on real names but that might have put more private members off participating in a public forum, so we compromised by allowing (and showing) usernames only, but keeping ‘real names’ in the Display Name field so at least other members would always know who they were talking to.

It works great across the rest of the site, but there is no point turning off the user cards with the private information (including name) if you then display this same information on another page. It seems it is inconsistent when it comes to privacy.

No. There is a site setting called enable names

Is it turned off?

Ah! It is enabled, but turning that off goes too far the other way (as I understand it)

I DO want their names to be shown to other logged-in users (i.e. other members of the society). I do not want to remove them from the site as a whole or 'Disable to hide full name everywhere'. I only want to hide this field to anonymous users. There is no reason to display anything other than usernames to anonymous users. That is what happens in the topics, why is this not the case in the directories?

Hmm…so I just tested this. If I have enable names, display name on posts, and hide user profiles from public all checked, full names do appear on posts for anonymous users. I couldn’t find a setting combination that would display full names on posts on for logged-in users.

Hide User Profiles from Public is doing what it’s intended to, it’s preventing access to the user’s profiles. A “full name” is not generally a secret, nor is it part of the “user profile”, hence why it is not hidden by this setting.

What you can do is hide the names via CSS. The following CSS hides the name field on badge pages for anonymous users only.

.anon .show-badge .name {
    display: none;
}
4 Likes

Thanks - that works well for the Badges

Can the same be done for Groups? What’s the class for that?

EDIT: I think I got it working with (is this going to cause any issues?):

.anon .user-detail .name {
    display: none;
}
1 Like

With any CSS change there can always be unexpected side effects, but given that the rule only targets anonymous users, and removes any name references (which is your goal) I think you’re set.

3 Likes

Can’t this become a feature? Enabling Hide User Profiles from Public, but still having a list of all TL1 users still gives a large list of users to people that don’t have an account. I know creating an account is easy to do, but the small threshold is nice. And without it the Hide User Profiles from Public option is incomplete and thus not really effective.

Bringing this back up (as it just came up for me), I’ve got an instance which is semi-private (betterstreets.nz). A few categories are public, but much (including user stuff) is not. Except for badges!

It seems these days that the User list is hidden from anon programatically (yay!), and you can configure each group to be hidden as well without much fuss.

However, Badges are still visible to anon. Is there a reason for this? I’ve hidden mine using:

// hide badges from anon
.anon .hamburger-panel .menu-panel a.badge-link {
    display: none;
}
.anon .badges-page div#main-outlet-wrapper {
    display: none;
}
1 Like

This topic was automatically closed after 2454 days. New replies are no longer allowed.