The question was small: a team had accidentally sent personal data to PostHog as a person property and needed to remove it for GDPR reasons.
This is technical guidance, not legal advice. The required deletion scope should be confirmed with the team responsible for privacy and compliance.
An AI answer produced four removal paths immediately: delete it in the UI, send an $unset payload, call an API, or delete the person. It sounded useful. The problem was not that every tool was wrong. The problem was the order.
What the AI missed
The AI treated deletion as a menu of commands. It did not begin by separating person-profile data from event data, asking which records were affected, or making the consequences of each route clear. In a privacy incident, that is the work. The command comes after the diagnosis.
Before choosing a deletion mechanism, a support engineer needs to ask one question:
In support work, I have learned that customers often arrive asking for a command. What they need first is a map of where their system put the data.
Where is the data?
That sounds obvious, but it changes the answer completely.
When PostHog receives $set or setPersonProperties(), it updates the current person profile. Those properties are not retained on the historical event that carried the update. So if the phone number was sent only as a person property, clearing that property is a much narrower job than deleting event data.
But “only” matters. The same value might also have been sent as an ordinary event property or through another event path. Those are different storage paths and need different fixes.
The first move is diagnosis, not deletion
I would begin with three checks:
- Which person profiles received the property?
- Was the same PII also captured as an event property?
- Does the request require removing one attribute, or erasing the person and all associated data?
Only then does the right fix become straightforward.
If it is only a person property
Stop the value being captured first. Then remove it from each affected profile. For a JavaScript implementation, PostHog exposes the native SDK method:
posthog.unsetPersonProperties(['phone_number'])
That is useful for an active user whose application can send the update. For profiles that already exist and need immediate cleanup, use the app or API for each affected person.
For an individual profile, the person-property deletion endpoint is another option:
POST /api/projects/:project_id/persons/:id/delete_property/
That endpoint is per person, not a bulk property-deletion tool. This distinction is exactly why the investigation comes first: a precise fix is safer than a dramatic one.
If the value also reached events
Clearing the person profile is not enough. The customer needs a targeted event-data deletion path. PostHog documents a self-service Data Deletion API for those requests. The right request depends on the affected events and properties, so this is where a support answer should slow down, establish scope, and make the trade-off clear before an action they cannot undo.
If the request requires deleting the person
Sometimes the requirement is to remove the person profile together with their historical events and session recordings. The Persons API supports that, but the destructive options must be explicit:
{
"distinct_ids": ["affected_user_id"],
"delete_events": true,
"delete_recordings": true
}
That is a different outcome from removing a property. Person deletion runs asynchronously, and event deletion covers events captured before the request. It should be chosen because it meets the requirement – not because it was the first option in a list.
The fix should also prevent the next incident
After the cleanup, trace how the field entered the pipeline. Remove it or hash it at the source. For broader safeguards, PostHog’s realtime transformations can drop or redact matching properties before storage.
This is the part I care about most in support work. The ticket is not complete when the immediate record is gone. It is complete when the customer understands what happened, has made the right data decision, and is less likely to be back with the same incident next week.
What a strong technical-support answer does
An AI can find related API names and produce plausible code quickly. That is useful. But in a privacy incident, a good answer must do more:
- identify the storage path before prescribing a fix;
- use the documented API or SDK method for that path;
- make one-way trade-offs explicit; and
- help the customer prevent recurrence.
The failure mode here was not a missing command. It was a missing diagnostic step. In technical support, the order of operations is part of the answer.