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:
Click the “Add user field” button to add a new field.
Choosing a field type
The field type determines the input field users will see on the signup form. Choose based on the kind of information you’re collecting:
Text field
Use for questions with many possible answers (e.g., “What company do you work for?”)
Displays as an HTML text input
Confirmation
Use for yes/no questions (e.g., “Would you like to sign up for our newsletter?”)
Displays as an HTML checkbox
Dropdown
Use for questions with a set number of possible answers (e.g., “What is your gender?”)
Displays as an HTML select input
To add options for a dropdown field:
Click on the option input
Type an answer and click “Create”
Repeat for additional options
The completed options should look similar to this:
Setting the field name and description
Field Name : Appears before the input on the signup form and user profile
Field Description : Appears after the input to help users complete the field
Both the field name and description are required to save a field.
Here’s how custom fields appear on the signup form:
Configuring user field options
Field Requirements
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:
Show on user card
When enabled, the field value will be displayed on the user card:
Searchable
When enabled, you can search for users based on their custom field values:
Saving and editing fields
Click “Save” to add the field to your site’s list of user fields
To edit a field, click the “Edit” button next to it in the list
To delete a field, click the “Delete” button
Adding custom fields to the user directory
Go to the user directory
Click the wrench icon:
Check the custom user fields you want to display
Click “Save”
The selected custom fields will now appear in the user directory table:
「いいね!」 39
これらの見出しの下に画像が2つ不足していると思います。
Meta.discourse.orgの画像欠落について に関連しているか分かりませんが、そちらにも投稿します。
引用では2枚目の画像が見えますが、元の投稿では見えません^^
「いいね!」 1
なるほど。それは興味深いですね。Missing images at Meta.discourse.org の問題に対する修正が来ると思うので、それで解決されるといいですね。
「いいね!」 2
カスタムユーザーフィールドの最大長を指定するために変更する必要がある設定はありますか?現在、テスト用のユーザーフィールドとして作成したこの「テスト」フィールドでは、ユーザープロファイルに1文字も入力できません(表示されているように「テスト」さえも)。
maiki
(maiki)
2024 年 7 月 30 日午後 7:21
68
URLはテキストなので、textフィールドは技術的には機能します。@Vaping_Community 。ただし、値の検証などの追加の詳細を求めているのかもしれません。
お考えの機能について、Feature トピックを検索または作成することもできます。
「いいね!」 3
カスタムユーザーフィールドで複数行/コンポーザーを使用する予定はありますか?
Sorry I don’t have a current installation to see for myself. I am planning to create a community that requires approval from a moderator to join. I’d like to have a custom field in the signup form where people can write a short note about themselves. Is this currently possible? If not please consider this as a feature request. Thank you!
langstonb
(Brittany Langston)
2025 年 7 月 22 日午後 5:30
71
カスタムユーザーフィールドにリンクを埋め込みたい場合は、HTML構文を使用する必要があります!
<a href="url">リンクテキスト</a>
たとえば、コミュニティガイドライン/ポリシーを承認するには:
「いいね!」 1
rey.riel
(Rey)
2025 年 10 月 6 日午後 4:56
75
Auth0 SSO のカスタムクレームをカスタムフィールドに連携することはできますか?現在、ユーザーは Auth0 でフィールド情報を入力してから、サインアップ時に再度入力する必要があります。可能であれば、値をマッピングしたいと思います。
dax
(Daniela)
2025 年 10 月 7 日午後 2:12
76
はい、可能です。
SSOエンドポイント内で、クレームをペイロードにマッピングする機能があります。例:
const ssoPayload = {
nonce: nonce,
email: user.email,
external_id: user.sub,
username: user.nickname,
name: user.name,
add_groups: a_custom_group,
'custom.user_field_1': user['https://yourdomain.com/company_id'],
'custom.user_field_2': [etc...]
「いいね!」 3
rey.riel
(Rey)
2025 年 10 月 7 日午後 2:44
77
@daxさん 、ありがとうございます。
DBでフィールド名を確認する方法はありますか?例えば、名(first name)フィールドがありますが、custom.firstname、custom.first_name、custom.firstNameを試しましたが、サインアップ画面でフィールドが入力されませんでした。
エラーログを確認し、トークンフィールドが上記のように表示されていることを確認しました。
rey.riel
(Rey)
2025 年 10 月 7 日午後 3:10
78
さらにコードを詳しく見ていますが、これはDiscourse Connect SSO専用ですか?Auth0プラグインを使用しています。
dax
(Daniela)
2025 年 10 月 7 日午後 4:51
79
構文は custom.user_field_x である必要があります。ここで x は /admin/config/user-fields/{x}/edit に表示される数値フィールド ID です。
rey.riel:
Auth0プラグインを使用しています。
そのマッピング機能はAuth0プラグインでは直接利用できません。
とはいえ、説明されていることを実現するためのオプションはまだあります。
テーマコンポーネントの作成。DiscourseのカスタムユーザーフィールドをAuth0に既に保存されている値と自動的に同期する小さなフロントエンドスクリプトを追加できます。たとえば、ユーザーがログインしたときにフィールドが空の場合、スクリプトはセキュアなエンドポイント(小さなクラウド関数)を呼び出して、Auth0からフィールド値を取得し、API経由でDiscourseプロファイルを更新できます。
自動化ツールの使用。ZapierやMakeなどの外部自動化サービスを使用して、Discourse外で同期を実行することもできます。利点は、コードの作成/保守を行う必要がなく、サードパーティサービスの料金を支払うだけで済むことです。
カスタム開発。Auth0プラグイン自体を拡張して、ログイン時にカスタムクレームをユーザーフィールドにネイティブにマッピングできるようにしたり、Auth0プラグインと連携するカスタムプラグインを構築したりできます。
テーマコンポーネントアプローチの明確な欠点は、カスタムコードを自分で作成および保守する必要があり、潜在的なバグや脆弱性を回避するためにセキュリティの観点からも注意が必要なことです。正直なところ、あなたの本番サイトのようなサイトにはお勧めできないソリューションです。
もし私があなたの立場なら、2番目のオプション(サードパーティツールの使用)に傾くか、Auth0プラグイン自体の強化のために機能リクエストまたはカスタムワークリクエスト(プロジェクトマネージャーの評価による)を提出することを検討します。
最後のオプションを検討することに興味がある場合は、プライベートで議論を続けることができます。
「いいね!」 1
stephtara
(Stephanie Booth)
2026 年 2 月 8 日午後 2:30
80
長いユーザーフィールドのリストを、一つずつ上下に移動させるための小さな矢印をシングルクリックするよりも、もっと簡単な再編成方法があるか知りたいです…
stephtara
(Stephanie Booth)
2026 年 2 月 8 日午後 2:39
81
ユーザーフィールド一覧の概要で、サインアップ時にあり、かつ必須のフィールド(例:「Je suis… Pays」)と、サインアップフォームにあり、オプションのフィールド(「Mes attentes」)を区別する方法が見当たりません。私が見落としているのでしょうか、それとも見落としでしょうか?フィールドを編集してオプションかどうかを確認しなければならないのは、かなり面倒です。(ここが適切な場所かどうかわかりませんでしたが、他にどこに投稿すべきかわかりませんでした。)
Moin
2026 年 2 月 8 日午後 2:54
82
データを提供するJSONが少しは役に立つかもしれません。見栄えは良くありませんが、/admin/config/user-fields.jsonを見て、以下のようなものを取得できます。
{
"id": 18,
"name": "Age",
"description": "How old are you?",
"field_type": "text",
"editable": true,
"required": false,
"requirement": "optional",
"show_on_profile": false,
"show_on_user_card": false,
"show_on_signup": false,
"searchable": false,
"position": 9
},
{
"id": 17,
"name": "pets",
"description": "choose your favourite",
"field_type": "dropdown",
"editable": true,
"required": false,
"requirement": "optional",
"show_on_profile": false,
"show_on_user_card": false,
"show_on_signup": false,
"searchable": false,
"position": 10,
"options": [
"cat",
"mouse",
"dog"
]
},
しかし、もちろん、これはインターフェース内の情報ほど見栄えの良いものではありません。
「いいね!」 1
stephtara
(Stephanie Booth)
2026 年 2 月 8 日午後 2:57
83