CYBERAUTOMATIONSStart a project
Privacy toolWorking build

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

YouConsole scriptInstagram pageLog in and open your comments activityPaste the script and press EnterCheck the page text for error messagesClick Select, then up to three rowsClick DeleteConfirmation dialogClick Delete in the dialogComment list loads againLog progress every 10 batches
  1. You to Instagram page: Log in and open your comments activity
  2. You to Console script: Paste the script and press Enter
  3. Console script to Instagram page: Check the page text for error messages
  4. Console script to Instagram page: Click Select, then up to three rows
  5. Console script to Instagram page: Click Delete
  6. Instagram page to Console script: Confirmation dialog
  7. Console script to Instagram page: Click Delete in the dialog
  8. Instagram page to Console script: Comment list loads again
  9. Console script to You: Log progress every 10 batches
One batch, from paste to the list loading again. Solid arrows are requests, dashed arrows are replies.
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 batches

Tech 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

ig-sanitize.js
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 failures
The settings at the top of ig-sanitize.js, with their defaults.

Source code

The code is public. View the IG Sanitize repository on GitHub.

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 services

More builds

Last updated 2026-11-11

Want something like this on your data?

Tell us what you want automated. If it fits, we will tell you exactly what it looks like and what it costs.