# Creating and configuring custom user fields

**URL:** https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192
**Category:** Site Management
**Tags:** how-to, user-custom-fields, users
**Created:** [April 2, 2019, 1:42am UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192 "2019-04-02T01:42:35Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [February 8, 2026, 3:29pm UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/84 "2026-02-08T15:29:42Z")

</div>

I think you could reorder them with the rails console. I chose to enter the fields with their IDs because it’s more difficult to type a name without typos

```plaintext
ids_in_order = [3, 7, 8, 5, 1, 2]

ids_in_order.each_with_index do |id, index|
  UserField.find(id).update!(position: index)
end

```

> [@Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349/1):
>
> > ⚠ Before working with the console it is **extremely** important that you have a recent backup. Mistakes can always happen!

---

<div class="post-metadata">

### Author: ![stephtara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephtara/32/517827_2.png) [@stephtara](https://meta.discourse.org/u/stephtara)
#### Post date: [February 11, 2026, 8:24am UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/85 "2026-02-11T08:24:43Z")

</div>

Here is what the “reorder categories” window looks like. I’m guessing if this exists in Discourse there could be a way to use it for user fields too?

 ![Screenshot 2026-02-11 at 09.23.20](https://global.discourse-cdn.com/meta/original/4X/c/c/2/cc2963d799dbbde075a21bf6f6b7b2eca6b63f47.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 11, 2026, 4:02pm UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/86 "2026-02-11T16:02:41Z")

</div>

I don’t believe so, but I recently wrote a theme component that hides the original display of custom fields on the user card and profile pages and then renders them again, optionally making some HTML-safe (they are adding some info via the API to a custom field that users can’t edit). I think the same idea could be used to add an order field to the custom fields to change the order they are displayed on the card and/or profile.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [February 11, 2026, 4:16pm UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/87 "2026-02-11T16:16:13Z")

</div>

I think you can use the existing methods for reordering the user fields. It is a little impractical that you have to open the menu again after every position change. This is somewhat annoying when moving across several positions.

 ![Screenshot_20260211_171234_Firefox](https://global.discourse-cdn.com/meta/original/4X/c/1/0/c100f14ac0b88abbab0d3c04978ee86e9b2e8a7f.jpeg)

But a component that would make the buttons always visible or a checkbox for a “reorder mode” at the top that makes them visible outside the menu could already improve the experience.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 11, 2026, 4:29pm UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/88 "2026-02-11T16:29:22Z")

</div>

> [@Moin](#):
>
> I think you can use the existing methods for reordering the user fields.

Oh. Funny. Yeah. Oops. That’s tons better than my idea. 🤣

---

<div class="post-metadata">

### Author: ![one1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/one1/32/493591_2.png) [@one1](https://meta.discourse.org/u/one1)
#### Post date: [April 8, 2026, 11:33am UTC](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192/89 "2026-04-08T11:33:46Z")

</div>

> [@Discourse](#):
>
> **Searchable** : Enables searching for users based on this field’s value in the user directory

I have a custom field and I have set it as searchable. However on the user page `/u` the only search field says “filter by username”. When I search for the contents of the custom field, no results show.

I can see the values in the list (I turned the column on in the customizer) So I can see that those values clearly exist.

What am I doing wrong?

Strangely, the values of the custom field are links, e.g. `u?cards=no&name=Female&order=likes_received` and when clicked it runs a search for the value in the `name` field. And it returns nothing.

These are the prefs for the field:

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/1/d/01d110bfd54a7a140f1416d80c46e9c189b8b50c.png)

Also (I don’t know if this is a clue) when I sort by that custom field column, whether it is forward or backward, there are always users with empty fields at the top of the list (different users) . Only a small number of users have content in this field, but I would have expected all the empties to be at the top _or_ the bottom of the list, not both.

[Previous page](https://meta.discourse.org/t/creating-and-configuring-custom-user-fields/113192.md?page=1)
