# Is it possible to export Admin User Notes?

**URL:** https://meta.discourse.org/t/is-it-possible-to-export-admin-user-notes/413008
**Category:** Data & reporting
**Created:** [September 22, 2026, 1:02pm UTC](https://meta.discourse.org/t/is-it-possible-to-export-admin-user-notes/413008 "2026-09-22T13:02:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mark07](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mark07](https://meta.discourse.org/u/Mark07)
#### Post date: [September 22, 2026, 1:02pm UTC](https://meta.discourse.org/t/is-it-possible-to-export-admin-user-notes/413008/1 "2026-09-22T13:02:15Z")

</div>

When a Community member requests a Subject Access Request (SAR) we would provide a copy of their User Notes left by mods etc.

Can these be exported into a csv (or similar)?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 22, 2026, 2:03pm UTC](https://meta.discourse.org/t/is-it-possible-to-export-admin-user-notes/413008/2 "2026-09-22T14:03:14Z")

</div>

I think you can do this via the Rails console. Run:

```bash
./launcher enter app
rails c

```

to enter the console. Then:

```ruby
DiscourseUserNotes.notes_for(user_id)

```

Replace `user_id` with the user’s id. This returns a JSON of the user notes.

---

<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: [September 22, 2026, 3:06pm UTC](https://meta.discourse.org/t/is-it-possible-to-export-admin-user-notes/413008/3 "2026-09-22T15:06:32Z")

</div>

You can export the results of a [data explorer](https://meta.discourse.org/t/32566?silent=true) query as a CSV file (or JSON).

I adjusted the query shared in [Analyzing Moderation and Flagging Activity Reports](https://meta.discourse.org/t/analyzing-moderation-and-flagging-activity-reports/352174#p-1710617-user-notes-24) to return all notes tied to a specific user instead of a time span. I also removed most columns from the original because I don’t think the author of the note should be included in your case.

```sql
-- [params]
-- user_id :user_id

WITH user_notes AS (

    SELECT 
        REPLACE(key, 'notes:', '')::int AS user_id,
        notes.value->>'raw' AS user_note
    FROM plugin_store_rows,
    LATERAL json_array_elements(value::json) notes
    WHERE plugin_name = 'user_notes'
    ORDER BY 2 DESC 
)

SELECT un.user_note
FROM user_notes un
JOIN users u ON u.id = un.user_id
WHERE un.user_id = :user_id

```
