Skip to content

Instantly share code, notes, and snippets.

@dakshb4050
Last active March 30, 2026 14:01
Show Gist options
  • Select an option

  • Save dakshb4050/2e47cafa1dc03af8d9c1a738dd60a3e9 to your computer and use it in GitHub Desktop.

Select an option

Save dakshb4050/2e47cafa1dc03af8d9c1a738dd60a3e9 to your computer and use it in GitHub Desktop.
Delete all Instagram comments automatically - Working 2026 | Paste in browser console on your_activity/interactions/comments page
/**
* Instagram Comment Bulk Deleter - Working 2026
*
* Deletes ALL your Instagram comments automatically.
* Tested and verified working on March 2026.
*
* HOW TO USE:
* 1. Go to: https://www.instagram.com/your_activity/interactions/comments
* 2. Open browser console: Press F12 → click "Console" tab
* 3. Paste this entire script and press Enter
* 4. Leave the tab open — it will run until all comments are deleted
*
* NOTES:
* - Deletes in batches of 10 to avoid Instagram rate limits
* - Waits 20 seconds between batches (do not reduce this)
* - Auto-dismisses any "Something went wrong" popups
* - Safe to re-run if it stops midway
*/
;(async function () {
const BATCH_SIZE = 10
const PAUSE_DURATION = 20000
const DELAY = (ms) => new Promise(r => setTimeout(r, ms))
const reactClick = (el) => {
el.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }))
el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }))
el.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }))
el.dispatchEvent(new MouseEvent('click', { bubbles: true }))
}
const waitFor = async (fn, maxWait = 6000) => {
const start = Date.now()
while (Date.now() - start < maxWait) {
const el = fn()
if (el) return el
await DELAY(300)
}
return null
}
// Background dialog dismisser
const dialogDismisser = setInterval(() => {
const okBtn = [...document.querySelectorAll('button, div[role="button"]')]
.find(b => b.innerText.trim() === 'OK')
if (okBtn) {
console.log('⚠️ Auto-dismissed error dialog')
reactClick(okBtn)
}
}, 1000)
let totalDeleted = 0
while (true) {
// ✅ Re-enter Select mode every batch
const selectBtn = await waitFor(() =>
[...document.querySelectorAll('div._ap3a._aaco._aacw._aad0._aad6')]
.find(el => el.innerText.trim() === 'Select')
)
if (!selectBtn) {
console.log('✅ No more Select button — all done! Total deleted:', totalDeleted)
break
}
reactClick(selectBtn)
await DELAY(1500)
const comments = [...document.querySelectorAll('[aria-label="Image with button"]')]
if (comments.length === 0) {
console.log('✅ No comments found — all done! Total deleted:', totalDeleted)
break
}
const batchSize = Math.min(BATCH_SIZE, comments.length)
console.log(`🗑️ Selecting ${batchSize} comments...`)
for (let i = 0; i < batchSize; i++) {
reactClick(comments[i])
await DELAY(400)
}
await DELAY(1500)
const deleteBtn = await waitFor(() =>
[...document.querySelectorAll('[aria-label="Delete"]')]
.find(el => el.style.pointerEvents === 'auto')
)
if (!deleteBtn) { console.error('❌ Delete button not found'); break }
reactClick(deleteBtn)
await DELAY(1000)
const confirmBtn = await waitFor(() =>
[...document.querySelectorAll('button._a9--')]
.find(b => b.innerText.trim() === 'Delete')
)
if (!confirmBtn) { console.error('❌ Confirm button not found'); break }
reactClick(confirmBtn)
await DELAY(2500)
totalDeleted += batchSize
console.log(`✔️ ${totalDeleted} deleted — waiting 20 seconds...`)
await DELAY(PAUSE_DURATION)
console.log('▶️ Resuming...')
}
clearInterval(dialogDismisser)
})()
@dakshb4050
Copy link
Copy Markdown
Author

Reference of working :

Blur_Screenshot 2026-03-30 185431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment