# Source: https://langfuse.com/docs/administration/data-deletion.md

---
description: Delete data from Langfuse
sidebarTitle: Data Deletion
---

# Data Deletion

There may be use-cases where you want to remove selected data from Langfuse, like erroneously created traces in a development flow, user data for PII, or your whole project.
In case you want to retain only recent data, you can use our [Data Retention](/docs/data-retention) feature.

You can delete unwanted data from Langfuse by:

- Deleting a single trace;
- Deleting a batch of traces;
- Deleting all traces that match a query filter;
- Deleting a project;
- Deleting an organization; or
- Deleting a user account.

Below, we will walk through each of the options and their guarantees.

## Deleting Traces

Note that all trace deletions will delete related entities like scores and observations across all data storages.

### Single Trace

<LangTabs items={["Langfuse UI", "API"]}>

<Tab>

To delete a single trace, open its detail view and hit the `Delete` button.
Confirm that you want to delete the given trace.

<Frame className="my-10" fullWidth>
  ![Delete a single trace](/images/docs/delete-single-trace.png)
</Frame>

</Tab>

<Tab>

```
DELETE /api/public/traces/{traceId}​
```

See [reference](https://api.reference.langfuse.com/#tag/trace/DELETE/api/public/traces/%7BtraceId%7D).

</Tab>

</LangTabs>

### Batch of Traces

<LangTabs items={["Langfuse UI", "API"]}>

<Tab>

To delete a batch of traces, select them in the trace list and select `Delete` in the `Actions` dropdown.

<Frame className="my-10" fullWidth>
  ![Delete a batch of traces](/images/docs/delete-trace-batch.png)
</Frame>

</Tab>

<Tab>

```
DELETE /api/public/traces
```

See [reference](https://api.reference.langfuse.com/#tag/trace/DELETE/api/public/traces).

</Tab>

</LangTabs>

### Delete by Query

<LangTabs items={["Langfuse UI"]}>

<Tab>

To delete all traces that match a query filter, configure your desired filter in the traces list.
Select all items on the current page and change that to all items in the top bar.
Then select `Delete` in the `Actions` dropdown.

<Frame className="my-10" fullWidth>
  ![Delete traces by query](/images/docs/delete-filtered-traces.png)
</Frame>

</Tab>

</LangTabs>

### Limitations

Most deletions in Langfuse happen instantly, but the deletion of tracing data does not.
Removing those records from our data warehouse is a resource intensive operation and, therefore, we rate limit
how many deletions we process at any point in time.
Usually, trace data is deleted from our system within 15 minutes of the delete call and there is no confirmation, i.e.
To verify that your data got deleted, you will have to query it again.

## Deleting a Project

<LangTabs items={["Langfuse UI"]}>

<Tab>

To delete a project, navigate to the project settings and scroll to the `Danger Zone` within the `General` section.
Confirm that you want to delete your project.
This action immediately revokes all API keys and schedules the project for deletion.
Within the next minutes, all related data is irreversibly removed from our system.

<Callout type="warning">
  Deleting a project is irreversible and all data will be removed. Be cautious
  when executing this action. After confirming the deletion, it will take up to
  5 minutes for the project to be deleted.
</Callout>

</Tab>

</LangTabs>

## Deleting an Organization

<LangTabs items={["Langfuse UI"]}>

<Tab>

If there are no projects left in an organization, you can delete the organization in the organization settings.
Navigate to the organization settings and scroll to the `Danger Zone` within the `General` section.
Confirm that you want to delete your organization.
The organization and all associated user information will be removed from our system.

</Tab>

</LangTabs>

## Deleting a User Account (Cloud)

<LangTabs items={["Langfuse UI"]}>

<Tab>

Users can delete their own account from the Account Settings page. Navigate to Account Settings from the user menu in the bottom right.

If you are the sole owner of an organization, you must first transfer ownership to another user or delete the organization before you can delete your account.

<Frame className="my-10">
  ![Delete user account](/images/docs/delete-account-settings.png)
</Frame>

</Tab>

</LangTabs>

## Deleting a User Account (Self-Host)

Remove the corresponding user record from the `users` table and drop all foreign keys to it using cascade.