This guide explains how to create and configure custom user fields in Discourse, including how to add them to the signup form, user profiles, and user directory.
Required user level: Administrator
Custom user fields allow you to collect additional information from your users beyond the standard profile fields. These fields can be displayed on user cards, user summary pages, and even retrieved using the Data Explorer plugin. This guide will walk you through the process of creating and configuring custom user fields.
Adding a user field
Go to Admin > Community > User Fields (discourse.example.com/admin/config/user-fields).
If you haven’t created any user fields yet, you’ll see this screen:
Optional - Optional fields may be left empty by users
For all users - When a field is required by all users, every account, including logged on users will be forced to fill it. This is very useful for cases such as a terms-of-service (ToS) requirement.
On signup - All new account will be required to fill the field.
Additionally, at the bottom of the creation form, you’ll find these options:
Editable after signup: Allows users to update the field from their profile page
Required at signup: Makes the field mandatory during account creation
Show on public profile: Displays the field value on the user’s summary page
Show on user card: Shows the field value on the user card
Searchable: Enables searching for users based on this field’s value in the user directory
Show on public profile
When enabled, the field value will be shown on the user’s profile page:
Is there a setting I have to modify to specify the maximum length of a custom user field? Right now, in this “Test” field that I created as a test user field, I cannot enter even a single character on my user profile (or even “Test”, as shown).
As URLs are text, the text field technically works, @Vaping_Community. However, you may be asking for additional details such as value validation or similar.
You might search or create a feature topic with what you have in mind.
Am I able to tie in a custom claim from my Auth0 SSO to a custom field? Currently the user enters field information in auth0, then has to enter it a second time when signing up. I’d like the value to be mapped over if possible
Is there a way to verify the field name in the db? For example, we have a first name field, I tried custom.firstname, custom.first_name and custom.firstName, none of which resulted in the fields being populated in the sign up screen.
I’ve checked the error logs to confirm the token fields are coming in as shown above.
The syntax needs to be custom.user_field_x, where x is the numeric field ID shown in /admin/config/user-fields/{x}/edit.
That mapping feature is not available in the Auth0 plugin directly.
That said, there are still options to achieve what you’re describing:
creating a theme component. You can add a small front-end script that automatically syncs a Discourse custom user field with a value already stored in Auth0. For example, when a user logs in and the field is empty, the script can call a secure endpoint (a small cloud function) that fetches the field value from Auth0 and updates the Discourse profile via API.
using automation tools. You could also use external automation services like Zapier or Make to perform that sync outside of Discourse. The advantage is that you don’t have to write/maintain code but only pay for the third-party service
custom development. We can extend the Auth0 plugin itself to natively support mapping custom claims into user fields on login, or build a custom plugin that works in pair with the Auth0 plugin.
A clear drawback of the theme component approach is that you’d need to write and maintain custom code yourself, while also being careful from a security standpoint to avoid introducing potential bugs or vulnerabilities. Honestly, it’s not a solution I’d recommend for a production site like yours.
If I were in your position, I’d lean more toward the second option, using third-party tools, or consider submitting a feature request or custom work request (depending on our project managers’ evaluation) to enhance the Auth0 plugin itself.
If you’re interested in exploring the last option, we can continue the discussion privately.