Bulk delete your own Instagram comments from the browser console
A script you paste into the browser console on Instagram's own comments activity page. It ticks three of your comments, deletes them, confirms, and repeats until the list is empty or Instagram starts returning errors.
- comments deleted per batch
- 3
- longest wait for an Instagram error to clear
- 30 s
- installs needed for the console script
- 0
The problem
Every comment you leave on Instagram stays public on the post where you left it. Instagram lets you remove your comments from the Your Activity page, but only by selecting a few at a time by hand.
For an account with years of comments that means the same clicks repeated hundreds of times: Select, tick, Delete, confirm, wait for the list to reload.
The approach
- The script runs in the tab where you are already logged in and uses the buttons Instagram shows you. It never asks for or reads a password, and the console script makes no network requests of its own.
- It finds the Select button by its text, clicks up to three comment rows that are not ticked yet, clicks the Delete button that accepts clicks, then clicks Delete inside the confirmation dialog.
- Before each batch it reads the page text for Instagram's error messages. If one is showing, it rechecks every half second for up to 30 seconds, carries on when the message clears, and stops if it does not.
- Three failures in a row (the list not loading, a missing Delete button or a missing confirm button) stop the script, and it logs how many batches it finished.
- A second script, written in Python, drives the same clicks from outside the browser through the Chrome DevTools Protocol. It reloads the comments page when the list stops loading and keeps a batch count in the page's local storage between runs.
- The pauses and the batch size are constants at the top of the file, so you can slow the script down before you paste it.
How it flows
- You to Instagram page: Log in and open your comments activity
- You to Console script: Paste the script and press Enter
- Console script to Instagram page: Check the page text for error messages
- Console script to Instagram page: Click Select, then up to three rows
- Console script to Instagram page: Click Delete
- Instagram page to Console script: Confirmation dialog
- Console script to Instagram page: Click Delete in the dialog
- Instagram page to Console script: Comment list loads again
- Console script to You: Log progress every 10 batches
Show this diagram as Mermaid text
sequenceDiagram
participant P0 as You
participant P1 as Console script
participant P2 as Instagram page
P0->>P2: Log in and open your comments activity
P0->>P1: Paste the script and press Enter
P1->>P2: Check the page text for error messages
P1->>P2: Click Select, then up to three rows
P1->>P2: Click Delete
P2-->>P1: Confirmation dialog
P1->>P2: Click Delete in the dialog
P2-->>P1: Comment list loads again
P1-->>P0: Log progress every 10 batchesTech stack
- Console script
- Plain JavaScript in one file, no dependencies
- Runner
- Python with the websockets package
- Browser control
- Chrome DevTools Protocol on local port 9222
- Saved progress
- One batch count in the page's localStorage (runner only)
- License
- MIT
Results
- With the default settings the fixed waits come to at least 5.2 seconds per batch of three, so the console script tops out at about 34 comments a minute. It is slow on purpose.
- The script works only with Instagram set to English, because it finds buttons and error messages by their English text.
- It depends on Instagram's page structure. If the comment rows stop matching, the script can report that everything is deleted when it is not, so reload the page and check.
- Deletion is permanent as far as the tool goes: it has no undo and keeps no copy. Instagram's terms may not allow automated clicks, so read them and run it on your own account at your own risk.
Every figure on this page comes from the project's own code, tests or notes. Where there is no measured number, we describe the outcome in words.
Demo
const DELETION_BATCH_SIZE = 3
const DELAY_BETWEEN_ACTIONS_MS = 1000
const DELAY_BETWEEN_CHECKBOX_CLICKS_MS = 300
const MAX_RETRIES = 60
const RATE_LIMIT_COOLDOWN_MS = 30000 // Wait 30s if rate limited
const MAX_CONSECUTIVE_ERRORS = 3 // Bail after 3 consecutive failuresSource code
The code is public. View the IG Sanitize repository on GitHub.
Related
Service
Data broker removal and privacy monitoring
Ongoing scans and opt-out requests across data broker sites, with scheduled re-checks.
See all custom build servicesFree tools built the same way
More builds
- AI Stack CVE Labs: Security research
- Agentic Agency: Agent framework
- AI Usage Dashboard: AI infrastructure and operations
- Geo-Intel: Data pipeline
- Security Knowledge Base: Knowledge base
- RapidAPI MCP: API integration
- Claude Budget: AI spend control
- Flightdeck: Agent operations
- Niagara BQL and NEQL Reference: OT reference
- WinHostPEAS: Security tooling
Last updated 2026-11-11