# How to delete users, but keep their posts (even if users have multiple posts or 1 post)?

**URL:** https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897
**Category:** Support
**Created:** [May 23, 2023, 9:44am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897 "2023-05-23T09:44:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![hoangviet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hoangviet/32/174417_2.png) [@hoangviet](https://meta.discourse.org/u/hoangviet)
#### Post date: [May 23, 2023, 9:44am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/1 "2023-05-23T09:44:16Z")

</div>

Many thanks to everyone who will help, I love Discourse, a forum platform I think is the best.

How to delete users (including anonymous or non-anonymous), but keep their posts, even if users have multiple posts or 1 post.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 23, 2023, 9:50am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/2 "2023-05-23T09:50:34Z")

</div>

Can you clarify a bit about what you are trying to achieve?

Do you want all the user data except for posts to be deleted, and posts to be only soft-deleted (kept in the database, not visible publicly)?

I believe if you delete a user, all the posts are soft-deleted. I tried on my test instance:

I don’t know if they are cleaned up after a while, and I believe attachments will be removed after some time.

I’d need confirmation on this. 🙂

---

<div class="post-metadata">

### Author: ![hoangviet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hoangviet/32/174417_2.png) [@hoangviet](https://meta.discourse.org/u/hoangviet)
#### Post date: [May 23, 2023, 10:00am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/3 "2023-05-23T10:00:43Z")

</div>

Thanks Panapin,  
some of my users violate community rules. But they have some quality posts, so I want to keep posts, delete users (I also need to delete users in database)

---

<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: [May 23, 2023, 10:05am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/4 "2023-05-23T10:05:51Z")

</div>

Maybe anonymizing fits your needs

> [@Anonymizing Users in Discourse](https://meta.discourse.org/t/anonymizing-users-in-discourse/86929):
>
> If you want to permanently remove a user from your community, but also preserve their contributions to Discourse, you can anonymize that user. How do I anonymize a user? At the bottom of a user’s admin page, there is an “Anonymize User” button: You’ll be asked to confirm. If you agree, the user will be anonymized. How thorough is the anonymization? The user will no longer be able to log in to your community as this specific account. A new username will be randomly assigned to t…

---

<div class="post-metadata">

### Author: ![hoangviet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hoangviet/32/174417_2.png) [@hoangviet](https://meta.discourse.org/u/hoangviet)
#### Post date: [May 23, 2023, 10:39am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/5 "2023-05-23T10:39:25Z")

</div>

I want to delete these users in the database, to save Ram and CPU for the server.  
If you change to an anonymous user, a new user will be created, thereby taking up ram, cpu

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 23, 2023, 10:57am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/6 "2023-05-23T10:57:46Z")

</div>

> [@hoangviet](#):
>
> to save Ram and CPU for the server.

I’m fairly sure it won’t. User data outside posts is **completely** negligible.

Also, anonymizing a user doesn’t create a new user, it replaces the current one’s info.

You are looking at a problem that doesn’t exist. 🙂

---

<div class="post-metadata">

### Author: ![hoangviet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hoangviet/32/174417_2.png) [@hoangviet](https://meta.discourse.org/u/hoangviet)
#### Post date: [May 23, 2023, 11:52am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/7 "2023-05-23T11:52:03Z")

</div>

Thanks [Coin-coin le Canapin](https://meta.discourse.org/u/Canapin) and Moin. Thank you for supporting me

---

<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: [June 22, 2023, 11:52am UTC](https://meta.discourse.org/t/how-to-delete-users-but-keep-their-posts-even-if-users-have-multiple-posts-or-1-post/265897/8 "2023-06-22T11:52:54Z")

</div>

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