Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shadrix's avatar
Level 12

What are your thoughts on Soft Deleting?

I'm curious what you are thinking about soft deleting?

Where are you using it?

Let's say we have a Forum Thread with Comments and Likes.

The owner of the thread decides to delete the thread. Are you going to hard or soft deleting the thread plus the comments and likes?

I'm not sure how to handle it, because "what if" I need that information of the thread or the comments. (I had one case 10 years ago, where the police asked for a dataset of a user).

0 likes
3 replies
oscarteg's avatar
oscarteg
Best Answer
Level 1

Laws like the GDPR limits what you can and can not soft delete, so that limits your options. I would think to soft delete if it is really important to be able to restore at a later time.

1 like
rwashingtonTA's avatar

I would suggest using it everywhere that you don't have to not use it. Keeping data for as long as possible almost always makes sense.

Obviously, there are situations where hard deletes are required. But I would always default to soft.

1 like
shadrix's avatar
Level 12

@oscarteg that's a really good tip, didn't know about it!

@rwashingtonTA It was my same thought but wasn't sure. Know I have to check how I can merge it with the GDPR law...

Please or to participate in this conversation.