- Go to your profile on instagram.com (sign in if not already)
- Click on
XXX followingfor 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?