# Data Explorer 'anonymous\_users' table

**URL:** https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610
**Category:** Support
**Tags:** data-explorer
**Created:** [January 11, 2025, 3:35am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610 "2025-01-11T03:35:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![gassim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gassim/32/220910_2.png) [@gassim](https://meta.discourse.org/u/gassim)
#### Post date: [January 11, 2025, 3:35am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/1 "2025-01-11T03:35:07Z")

</div>

Hey  
The ‘anonymous users’ table in [Data Explorer](https://meta.discourse.org/t/32566?silent=true) is returning a list of actual users with user\_id. They’re not really ‘anonymous’ nor ‘anonymized.’

It’s not making any sense and I’m trying to understand what this table is and why the random list of 46/11000 users are in that list.

You can run:

```plaintext
SELECT * FROM anonymous_users

```

This table is referred to on the repo as: [discourse/app/models/anonymous\_user.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/models/anonymous_user.rb)

Any clue?

Thanks!

---

<div class="post-metadata">

### Author: ![anon16030817](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@anon16030817](https://meta.discourse.org/u/anon16030817)
#### Post date: [January 11, 2025, 3:38am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/2 "2025-01-11T03:38:59Z")

</div>

Anonymized users are completely wiped of their data, except their actions on the site.

Is this what you were asking?

---

<div class="post-metadata">

### Author: ![gassim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gassim/32/220910_2.png) [@gassim](https://meta.discourse.org/u/gassim)
#### Post date: [January 11, 2025, 3:49am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/3 "2025-01-11T03:49:30Z")

</div>

Hi @anon16030817

Thanks for your response. My question is about the table itself. I understand the idea behind anonymous and anonymized, but when I run the query in [data explorer](https://meta.discourse.org/t/32566?silent=true):

```plaintext
SELECT * FROM anonymous_users

```

I see a list of random users including my account, so I don’t understand what this table itself is and why these users (who are not anonymous nor anonymized) appear there.

Thanks!

---

<div class="post-metadata">

### Author: ![anon16030817](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@anon16030817](https://meta.discourse.org/u/anon16030817)
#### Post date: [January 11, 2025, 3:50am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/4 "2025-01-11T03:50:20Z")

</div>

I’m sorry, I don’t really know about this, I thought you were talking about anonymized users.

Good luck on this!

---

<div class="post-metadata">

### Author: ![gassim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gassim/32/220910_2.png) [@gassim](https://meta.discourse.org/u/gassim)
#### Post date: [January 11, 2025, 3:51am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/5 "2025-01-11T03:51:56Z")

</div>

It’s okay! Thanks for the help!

The table naming is not making sense so I understand it could even confuse people from understanding my question 😅

---

<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: [January 11, 2025, 7:38am UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/6 "2025-01-11T07:38:56Z")

</div>

> [@gassim](#):
>
> I see a list of random users including my account, so I don’t understand what this table itself is and why these users (who are not anonymous nor anonymized) appear there

There are 3 cases where users can be anonymous

- when they are not logged in
- when they were anonymized
- when they use #anonymous-mode

The table is also mentioned in the admin documentation about anonymous mode.

> [@Enable and configure anonymous mode](https://meta.discourse.org/t/enable-and-configure-anonymous-mode/155638/1):
>
> ## Finding an anonymous user’s regular account
> 
> While anonymous mode provides anonymity in the Discourse user interface, the Discourse database can still associate anonymous accounts with their regular user accounts. Use the following [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query to find the association:
> 
> ```plaintext
> SELECT a.username AS anonymous_username, u.username AS original_username
> FROM users u
> JOIN anonymous_users au ON (u.id = au.master_user_id)
> JOIN users a ON (a.id = au.user_id)
> 
> ```

---

<div class="post-metadata">

### Author: ![gassim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gassim/32/220910_2.png) [@gassim](https://meta.discourse.org/u/gassim)
#### Post date: [January 11, 2025, 2:53pm UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/7 "2025-01-11T14:53:52Z")

</div>

Hi @Moin

Thank you so much! This is very helpful. Anonymous mode is not enabled in our instance, and I updated the settings again so now I no longer see the list when I run the query. It’s solved now.

Thanks!

---

<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: [February 10, 2025, 2:54pm UTC](https://meta.discourse.org/t/data-explorer-anonymous-users-table/346610/8 "2025-02-10T14:54:14Z")

</div>

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