# Change the interface language for many users via a database query?

**URL:** https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635
**Category:** Support
**Created:** [December 18, 2025, 7:42am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635 "2025-12-18T07:42:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [December 18, 2025, 7:42am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/1 "2025-12-18T07:42:12Z")

</div>

I’m wondering if someone could help me with a support request please.

I need to update the preferences of all our users who currently have an interface language of `English (US)` and change them over to use `English (UK)` instead.

Is there a [data explorer](https://meta.discourse.org/t/32566?silent=true) query I can craft to issue some kind of SQL UPDATE query with a where clause on it to catch only the English (US) ones?

For reference / insight… we’ve recently spent a lot of time updating all our `Site texts` on the English (UK) language and during testing we’ve found that anyone who signed up to our platform more than a year ago was defaulting to the old default site setting of English (US), rather than English (UK), approx 15k users need updating.

---

<div class="post-metadata">

### Author: ![jahan\_gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jahan_gagan/32/501948_2.png) [@jahan\_gagan](https://meta.discourse.org/u/jahan_gagan)
#### Post date: [December 18, 2025, 8:54am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/2 "2025-12-18T08:54:42Z")

</div>

You can’t run `UPDATE` queries via the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin because it is strictly read-only.

For bulk updates like this, use the Rails console instead:

```plaintext
User.where(locale: 'en').update_all(locale: 'en_GB')

```

For more examples of updating user preferences in bulk, refer to:

> [@Edit a user preference for everyone or a subset of users](https://meta.discourse.org/t/edit-a-user-preference-for-everyone-or-a-subset-of-users/25162):
>
> bookmark This guide explains how to edit a user preference for everyone or a subset of users in Discourse. person_raising_hand Required user level: System Administrator warning Console access is required. If you need to update the user preference for all of your users or a large subset of users, you can do so via the rails console. Summary In this guide, you’ll learn: How to access the Rails console for making bulk changes Examples of modifying user preferences How to identify se…

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [December 18, 2025, 8:54am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/3 "2025-12-18T08:54:45Z")

</div>

If I run this in [Data Explorer](https://meta.discourse.org/t/32566?silent=true):

```plaintext
SELECT
  u.locale,
  COUNT(*) AS user_count
FROM users u
WHERE u.active = TRUE
  AND u.locale IN ('en', 'en_GB')
GROUP BY u.locale
ORDER BY user_count DESC, u.locale

```

I get:

| locale | user\_count |
| --- | --- |
| en\_GB | 19479 |
| en | 16014 |

I need to UPDATE the 16,014 `en` users to be `en_GB`.

And I’m not brave enough to run an update query on prod 😊

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [December 18, 2025, 8:55am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/4 "2025-12-18T08:55:25Z")

</div>

> [@jahan\_gagan](#):
>
> You can’t run `UPDATE` queries via the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin because it is strictly read-only.

Phew 😅

> [@jahan\_gagan](#):
>
> ```plaintext
> User.where(locale: 'en').update_all(locale: 'en_GB')
> 
> ```

Fantastic, thank you! 🙇

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [December 18, 2025, 9:04am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/5 "2025-12-18T09:04:38Z")

</div>

Thanks @jahan_gagan

I took a DB backup first 😅

I then ran this:

> [@jahan\_gagan](#):
>
> ```plaintext
> User.where(locale: 'en').update_all(locale: 'en_GB')
> 
> ```

It worked perfectly:

```plaintext
Loading production environment (Rails 8.0.4)
discourse(prod)> User.where(locale: 'en').update_all(locale: 'en_GB')
=> 16016
```

And my [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query now responds with:

| locale | user\_count |
| --- | --- |
| en\_GB | 35493 |

Thank you 👏

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [January 17, 2026, 9:04am UTC](https://meta.discourse.org/t/change-the-interface-language-for-many-users-via-a-database-query/391635/6 "2026-01-17T09:04:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
