Can admins create user fields that are only visible/editable in the admin panel?

I noticed that custom user fields are always visible to users during signup or in their profiles, depending on the settings.

Is there currently a way to create a user field that’s only visible and editable by staff (for internal use), not exposed to users?

If not, would this be something the team might consider supporting in the future?

There is a feature request for that: Option to include user field that is only editable by staff
You may want to share your use case there to support the request.

Depending on what you want to use the field for, it may be sufficient to hide the user field for everyone except staff with a theme component.

1 Like

I run discourse for university courses, and the custom user field would be the student number. A theme component seems like an OK stopgap solution, but making a custom field completely invisible to anything but staff or system API would be cleaner.

Actually, I wonder if the option to hide the user field on sign up, which was added recently, makes user fields that users cannot see possible.

I think user fields are only shown to users when they are editable. So if you hide it on sign up and disable editing (and showing and searching) the field should be hidden for the user.

Configuration of the user field with all options disabled



The sign up form without the user field:



The user field is not visible for the user in their preferences:



The user field is visible for admins on the user’s profile:

2 Likes

Really appreciate your help earlier! I’ve drafted a bug report showing this behavior clearly.

Hey, I noticed a setting in the admin called “Staff user custom fields”. I’m not entirely sure what it’s for or how to use it.

Could you help me understand how this works? Thanks!

So far I had no use case for using custom fields through the API. So I cannot tell you more than what I learned from

Have a look at Discourse User Notes, a plugin now included in core. It’s meant for staff to internally share notes about users. (Loves cats – Golfs with the CEO – etc.)