Let people delete their account and data
Add a clear in-app way to delete an account and the personal data behind it, including in the third-party services that hold it.
Skip to the promptWho needs this
- People can create an account in your app or on your site.
- Your app is on the Apple App Store or Google Play (both require it).
- You have users in the EU, UK, California or another place with a right to deletion.
Why it matters
- People have a right to have their personal data erased under GDPR Art. 17, with a response due within one month (Art. 12(3)). California's CCPA and other US state laws give a right to request deletion, with a 45-day response time in California.
- Apple requires apps that support account creation to let people start account deletion inside the app (App Store Review Guideline 5.1.1(v)). Google Play requires apps with accounts to offer deletion in the app and through a web link.
- Deleting only the users row usually leaves data behind in other tables, file storage, email lists, analytics and payment systems.
Before you paste
- Your personal data map (see the free prompt for it), so you know every table and service that holds user data.
- Your billing setup (Stripe, Paddle, app store subscriptions), since active subscriptions must be handled first.
- What you must keep by law, such as invoices for tax, and for how long.
The prompt
Copy it into your AI builder. Fill in anything in [brackets] first, and review every change before you ship it.
Add complete account deletion to this app.
1. ENTRY POINT
- In account settings, add "Delete account". On mobile apps it must be inside the app, not only on the website.
- Ask the person to confirm: re-enter their password or a code sent by email (signed-in sessions can be stolen), then type DELETE.
- Before confirming, show what will be deleted, what will be kept and why (for example "We keep invoices for 7 years for tax law"), and what happens to an active subscription.
2. SUBSCRIPTIONS FIRST
- Cancel any active subscription with the payment provider before deleting. For app store subscriptions, tell the person they must cancel in their Apple or Google account settings, and link there.
3. DELETE EVERYWHERE
Using the data map, delete or anonymise the person's data in:
- every database table that references them (follow foreign keys; use ON DELETE CASCADE where it's safe)
- file storage (avatars, uploads)
- the auth provider (for Supabase, delete the auth user with the admin API from a server function, never from the browser)
- third parties: email and newsletter lists, CRM, analytics (use the provider's user-deletion API where it has one), support tools, AI provider logs if you store conversation IDs
- payment provider: remove personal details where the provider allows, keeping what tax law requires
Data shared with other users (comments in a shared workspace, messages) can be anonymised ("Deleted user") instead of removed, so others' content still makes sense.
4. TIMING
- Delete straight away, or offer a short grace period (for example 14 days) during which signing in cancels the deletion. Say which in the confirmation.
- Backups: note in the privacy notice that deleted data leaves backups as they expire, and when.
5. CONFIRM
- Sign the person out, show a confirmation page, and send a confirmation email to the address on file.
- Log the deletion request with a timestamp and outcome (no personal data in the log beyond an ID), so you can show you handled it.
6. PRIVACY NOTICE
- Add a short section on how to delete an account and how long it takes.
When you're done: list every file you changed, explain each change in one line, and give me a step-by-step test for each numbered item above. Don't change anything unrelated.Builder tips
Lovable
Ask Lovable to create a Supabase Edge Function for the deletion (it needs the service-role key, which must never reach the browser).
Claude Code
Ask it to list every foreign key that points at the users or profiles table before writing the deletion, so nothing is missed.
Cursor
Use Agent mode and @-mention the files that matter (your layout, auth and database files), so it reads them before editing.
Common mistakes
- Deleting the profile row but not the auth user, so the person can still sign in.
- Forgetting file storage, email lists and analytics.
- Calling the admin delete API from the browser with the service-role key.
- No re-authentication, so anyone with an open session can delete the account.
- Silently keeping data 'just in case' without a legal reason.
Check it worked
- 1Create a test account, upload a file, subscribe to the newsletter and make a test purchase in sandbox mode.
- 2Delete the account through the app.
- 3Search the database for the test email and user ID: nothing left except what the confirmation said is kept.
- 4Check storage, the email list, the analytics user and the payment provider: removed or anonymised as described.
- 5Try to sign in with the deleted account: it fails.
What a SafeLaunch scan adds
SafeLaunch checks whether your product offers deletion and the other rights each market requires, and which app store rules apply to your app package.
One free fix in your inbox each week
A new copy-paste prompt for Lovable, Cursor or Claude Code every week, with the rule behind it and how to check it worked. No spam, unsubscribe in one click.
By signing up you agree to get this weekly email. We send it with Kit, and you can unsubscribe at any time. What we share with Kit is in our privacy notice.
Questions
Sources
- GDPR (Regulation (EU) 2016/679)
- Apple: Offering account deletion in your app
- Google Play: Account deletion requirements
General guidance for common problems, not legal advice. Whether a rule applies depends on where you operate, who your users are and the size of your business.