כיצד למחוק משתמשים, אך לשמור את הפוסטים שלהם (גם אם למשתמשים יש מספר פוסטים או פוסט אחד)?

סיכום מבוסס בינה מלאכותית

In a support discussion titled ‘How to delete users, but keep their posts (even if users have multiple posts or 1 post)?’, hoangviet seeks to delete rule-violating users from the database while preserving their posts to save server resources. Canapin clarifies that deleting a user soft-deletes their posts (keeping them in the database but not publicly visible) and questions whether resource savings are necessary, noting user metadata is negligible. Moin suggests anonymizing users instead, linking to a relevant guide. hoangviet explains they want to fully remove users from the database to reduce RAM/CPU usage, fearing anonymization creates new users. Canapin counters that anonymization replaces, not creates, user records and reassures that user data outside posts consumes negligible resources — suggesting the concern may be unfounded. hoangviet thanks both for their help. The discussion highlights a misunderstanding about resource impact and recommends anonymization as a practical, non-destructive alternative to deletion.

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.

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. :slight_smile:

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)

Maybe anonymizing fits your needs

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

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. :slight_smile:

Thanks Coin-coin le Canapin and Moin. Thank you for supporting me