Automatically Unfollow Instagram Users who don’t Follow You Back

Have you followed users on Instagram and realized they have not followed you back so now your follow/follower ratio is a bit skewed.

It can take a lot of time investment removing non-followers. So here is the solution you can run from your own desktop.

Please note that Instagram does have a policy on automated processes

It does not cost you nor do you have to sign-up to a premium service or tool.

The instructions to open JS Console is for Google Chrome users

The method is to use a little java script & the JS Console in DevTools. Don’t worry its not too difficult.

If you are unfamiliar with JS Console see here for JS Console tutorial

 

Copy & paste the code below and hit enter to unfollow everyone who is not following you.

Note: It does take time to run…its quite slow but prevents you been locked out of your account.

 



The code was last tested on 07th September 2018

/*
Login to your Instagram Account
Open the Developer Console
Copy All the Code and place it in the Java Console
Hit Enter to Run
Sit back and Wait
*/

openFollowersWindow().then(function () {
populateUnfollowsPool();
digestUnfollowsPool();
});

function openFollowersWindow() {
var onFollowersWindowWasOpenedListeners = [];
var openWindowTimeout = 3000;

var followersElement = getFollowersElement();
followersElement.click();

function digestOnFollowersWindowWasOpenedListeners() {
onFollowersWindowWasOpenedListeners.forEach(function (onFollowersWindowWasOpenedListener) {
onFollowersWindowWasOpenedListener();
});
}

var wasOpened;
setTimeout(function () {
// TODO Verify that the window was indeed opened
wasOpened = true;
digestOnFollowersWindowWasOpenedListeners();
}, openWindowTimeout);
return {
then: function (onFollowersWindowWasOpened) {
if (wasOpened) {
onFollowersWindowWasOpened();
} else {
onFollowersWindowWasOpenedListeners.push(onFollowersWindowWasOpened);
}
}
};
}

function getFollowersElement() {
return getFollowersElementWithUsername(getUsername());
}

function getUsername() {
var pageTitleElement = document.getElementsByTagName('h1')[0];
if (!pageTitleElement) throw new Error('No title to get username from');
return pageTitleElement.innerHTML;
}

function getFollowersElementWithUsername(username) {
var followersElement = document.querySelectorAll('a[href="/' + username + '/following/"]')[0];
if (!followersElement) throw new Error('No followers element was found');
return followersElement;
}

var unfollowsPool;

function populateUnfollowsPool() {
var buttons = document.getElementsByTagName('button');
unfollowsPool = [];
for (var i = 0; i < buttons.length; i++) {
var button = buttons[i];
if (button.innerHTML.includes('Following')) {
var randomTimeoutForUnfollow = Math.floor((Math.random() * 60) + 58) * 1000;
console.log('Following button!');

var unfollow = {
buttonElement: button,
timeout: randomTimeoutForUnfollow
};

unfollowsPool.push(unfollow);
}
}
}

function digestUnfollowsPool() {
if (unfollowsPool.length === 0) {
console.log('Unfollow pool empty, repopulating');
populateUnfollowsPool();
}
var unfollow = unfollowsPool.shift();
var unfollowTimeout = unfollow.timeout;
console.log('Clicking unfollow button in ', unfollowTimeout);
setTimeout(function () {
var unfollowButtonElement = unfollow.buttonElement;
unfollowButtonElement.scrollIntoView(true);
console.log('Clicking unfollow button');
unfollowButtonElement.click();
//Second confirm
var el=document.getElementsByClassName("aOOlW -Cab_ ");
for (var i=0;i<el.length; i++) {
el[i].click();
}
console.log('Clicked. Continuing digesting unfollow pool');
digestUnfollowsPool();
}, unfollowTimeout);
}

 

Get your own Instagram automation platform with Postable.me – a 7 day free trial then $2.99/m

Postable is an easy to use post scheduler & Instagram automation platform!

Auto Like, Auto Follow, Auto Unfollow, Content Importing, Videos & Pictures

Quality content paired with good engagement is all you need to get there, With postable you have your own robot slaving away to ensure you’re engaging with your audience so you can focus on content!

Postable.me

I believe in synergy skills for creating quicker, more efficient experiences in technology and workflows I am a Photo Restoration artist & SEO consultant specialising in small business and start-ups.

Leave a Comment