- Go to your profile on instagram.com (sign in if not already)
- Click on
XXX following
for the popup with the users you're following to appear - Open Chrome Devtools and Paste the following into the Console and hit return:
(async function () {
const MAX_PER_DAY = 400; // Maximum number of unfollows allowed per day
const PAUSE_AFTER_BATCH = 10; // Pause after every 10 unfollows
const PAUSE_DURATION = 10 * 60 * 1000; // Pause duration: 10 minutes (in ms)
const delay = (ms) => new Promise(r => setTimeout(r, ms));
const randomDelay = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
const findButton = (txt) => [...document.querySelectorAll("button")].find(btn => btn.innerText === txt);
// Use localStorage to track today's date and unfollow count
const today = new Date().toISOString().split("T")[0]; // format: YYYY-MM-DD
const key = `unfollowed_${today}`;
const alreadyUnfollowed = parseInt(localStorage.getItem(key) || "0");
// If daily limit reached, stop immediately
if (alreadyUnfollowed >= MAX_PER_DAY) {
console.log(`π Daily limit of ${MAX_PER_DAY} unfollows already reached.`);
return;
}
window.STOP_UNFOLLOW = false;
let unfollowed = alreadyUnfollowed;
console.log(`π Start unfollow session (${unfollowed}/${MAX_PER_DAY} already unfollowed today)`);
for (let i = 0; unfollowed < MAX_PER_DAY; i++) {
if (window.STOP_UNFOLLOW) {
console.log("π Unfollow process manually stopped.");
break;
}
const nextButton = findButton("Following");
if (!nextButton) {
console.log("β No more 'Following' buttons found.");
break;
}
// 20% chance to "change mind" and skip unfollow (human-like randomness)
if (Math.random() < 0.2) {
console.log("π€ Skipped this one (random 'changed mind')");
window.scrollBy(0, 100);
await delay(randomDelay(1000, 2000));
continue;
}
nextButton.scrollIntoViewIfNeeded();
nextButton.click();
await delay(300);
const confirmButton = findButton("Unfollow");
if (confirmButton) {
confirmButton.click();
unfollowed++;
localStorage.setItem(key, unfollowed); // Save progress in localStorage
console.log(`β
Unfollowed #${unfollowed} today`);
} else {
console.log("β οΈ Confirm button not found");
}
window.scrollBy(0, randomDelay(50, 150)); // Simulate human scrolling
const waitTime = randomDelay(5000, 20000); // Wait 5β20 seconds randomly
console.log(`β³ Waiting ${Math.floor(waitTime / 1000)} seconds...`);
await delay(waitTime);
// After every batch, take a longer break
if (unfollowed % PAUSE_AFTER_BATCH === 0 && unfollowed !== 0) {
console.log(`π΄ Pausing for ${PAUSE_DURATION / 60000} minutes after ${unfollowed} unfollows`);
await delay(PAUSE_DURATION);
}
}
console.log(`π Finished session. Total unfollowed today: ${unfollowed}`);
})();
π Release Notes β v1.0.0 β Safe Instagram Unfollow Script
π Features Added β’ Safe Daily Limit: Adds MAX_PER_DAY variable with localStorage persistence to prevent Instagram soft bans. β’ Human-Like Delays: β’ Random delays between 5 and 20 seconds. β’ Scroll simulation (window.scrollBy) after each unfollow. β’ 20% chance to skip unfollow (simulates hesitation). β’ Batch Pausing: β’ Pauses for 10 minutes after every 10 unfollows to mimic human breaks. β’ Manual Kill Switch: β’ Add window.STOP_UNFOLLOW = true in console to stop at any time. β’ Persistent Count: β’ Progress is saved using localStorage. Script resumes intelligently on reload.
π Internal Improvements β’ Refactored to cleanly separate logic: UI interactions, delays, and tracking. β’ Fully commented for ease of modification or translation. β’ Fail-safes if buttons are not found or DOM changes.
π§ͺ Debug/Testing Tip
You can reset the count for testing with:
localStorage.removeItem('unfollowed_YYYY-MM-DD')
Replace YYYY-MM-DD with todayβs actual date.
I used chatGPT to vibe code safer version of script, also big thank you berstend for initial script, I wished to clean up my instagram feed so I could follow precious few people that I really want to follow
Thank you for the script, I am ready to run this script. Can you confirm this removes only the folks who are not following us, right?