my current configuration is, that discourse is readable if you are not logged in. Also I set “enable names” to see the full name right near the nick name.
But what I DONT want is, that not logged in users can see the full name. Is there any way to disable this? I didnt found it.
I was going to respond to this earlier with some CSS, but remembered the case where username and display name match, resulting in the username being hidden.
In that situation it would present an avatar, with no name whatsoever.
But still better than get crawled by any bots other forum software (plug-ins) hiding the full name and also anonymze the nick in e.g. to “user 34726”. Would be really perfect if I could hide at least the real name
I’m going to look into this when I get a chance. It should be doable with a small theme component. I’ve got a decent amount on my plate, so it maybe be a little bit before I get back to you with anything.
Alright, the script for removing the full name for anons is fairly simple. Just create a new theme component and add the following to the Common </head> section:
To better avoid full names getting out, it would be best to set the site setting hide_user_profiles_from_public
This code assumes you have prioritize_username_in_ux enabled
A user’s full name will be used as the title attribute for a user avatar, so it will be displayed whenever someone hovers over an avatar. I haven’t found a solution for this yet, but I’ll come back if one is found.
We’d like our forums to be publicly readable and indexed by search engines, but we’d like to not show real names unless you’re logged in (so that people’s real names aren’t exposed to non-members and search engines).
Is that possible? I tried the above code and could not get it working.
I just checked and the code still works. All of the notes I mention still apply.
I did try to track down all of the areas where the user’s full name was used as the title attribute of their avatar. The following code should cover all the areas assuming you have hide_user_profiles_from_public and prioritize_username_in_ux enabled. Unfortunately it relies on overriding a couple of templates, but they don’t change very often. I’ve included links to the files on GitHub if you ever want to check to see if you need to update any of the code. The only modification I made was either adding or changing the namePath so that it uses the username instead of the full name.
This shouldn’t be viewed as a 100% secure method, but it will keep the information out of sight from anyone that’s not trying hard to find it.
At some point it would be nice to have this functionality as core behavior whenever prioritize_username_in_ux is enabled.
@DavidO have you read through Beginner's guide to using Discourse Themes? If you created a theme component and added the code to the Common </head> section, be sure to add the component to your main theme.
I’m thinking about making part of my community public. To protect members who have contributed to that particular category, I would like to use something like this anonymizing script. However, I would not like to enable prioritize_username_in_ux. On the other hand, I wouldn’t mind obfuscating all names - user names as well as real names, and maybe even avatars. Is there a way to achieve this with a modification of the script?