Users as authors. Considerations needed before removing the user

panel, blueprint field and content: When deleting a user the author information is lost.
If I use a field of type user as author of a blog post and later delete this user the information re the author of this post is lost because the userID not exists anymore. Do I have to write a hook or what would be the best way to handle the user reference and the loss of data so when deleting the user the name of the author remains and can be saved? What would be the best approach or is there already a solution I only did not found ? ( I am using version 3.3.5 )

Apart from using a hook, an alternative would be to use another type of field (select or multiselect) that stores the name or email of the user instead of the id.

Another alternative would be to store a mapping of user ids and names in a database or file for future use.

The question to always keep in mind is data privacy. So if a user is removed, does that mean that all information regarding this user should be removed as well? If you store personal information like name or email instead of the id, make sure that users agree to this, particularly after they have been removed as users.

Thanks for your thoughts about and suggestions.

Another type of field let it miss the simple comfortability of linking author information stored in user account, if available - like ORCID ID or Website - and what I would use if possible.

Mapping in a database contra indicate the great value of databaseless CMS.

Maybe simpler than writing a hook would be not to delete the user with role author but delete only all content except the name.

The name remaining only in the system should not conflict with any privacy, particularly if the user had acted as author willing to publish, I think.
But you are right, keeping questions of privacy in mind is not trivial.

I was thinking SQLite database or even a simple text file. Not completely removing the user is another option, of course.