• Login
en
afsqam ar hy az eu be bn bs bg ca ceb ny zh-CN zh-TWco hr cs da nl en eo et tl fi fr fy gl ka de el gu ht ha haw iw hi hmn hu is ig id ga it ja jw kn kk km ko ku ky lo la lv lt lb mk mg ms ml mt mi mr mn my ne no ps fa pl pt pa ro ru sm gd sr st sn sd si sk sl so es su sw sv tg ta te th tr uk ur uz vi cy xh yi yo zu
Victor Mochere
No Result
View All Result
  • Business
  • Finance
  • Education
  • Travel
  • Technology
  • Living
  • Entertainment
  • Governance
  • Sports
en
afsqam ar hy az eu be bn bs bg ca ceb ny zh-CN zh-TWco hr cs da nl en eo et tl fi fr fy gl ka de el gu ht ha haw iw hi hmn hu is ig id ga it ja jw kn kk km ko ku ky lo la lv lt lb mk mg ms ml mt mi mr mn my ne no ps fa pl pt pa ro ru sm gd sr st sn sd si sk sl so es su sw sv tg ta te th tr uk ur uz vi cy xh yi yo zu
Victor Mochere
No Result
View All Result
en
afsqam ar hy az eu be bn bs bg ca ceb ny zh-CN zh-TWco hr cs da nl en eo et tl fi fr fy gl ka de el gu ht ha haw iw hi hmn hu is ig id ga it ja jw kn kk km ko ku ky lo la lv lt lb mk mg ms ml mt mi mr mn my ne no ps fa pl pt pa ro ru sm gd sr st sn sd si sk sl so es su sw sv tg ta te th tr uk ur uz vi cy xh yi yo zu
Victor Mochere
No Result
View All Result
Home Passé

How to mass follow or unfollow people on Twitter 2025

Victor Mochere by Victor Mochere
in Passé, Technology
Reading Time: 6 mins read
A A
4
How to mass follow or unfollow people on Twitter

Ever wanted to follow or unfollow people on Twitter aggressively without the hassle of clicking individual follow/unfollow buttons? Below are the codes you can use to mass follow or mass unfollow people on Twitter. But remember to use these Twitter follow/unfollow scripts for your own personal use/testing and respect Twitter rights.

Twitter mass follow script

To run Twitter mass follow script you have to use Chrome browser.

RelatedPosts

How to build a hospital management software system

How hospital management systems improve efficiency in healthcare delivery

How to remove watermarks from ChatGPT text

Things to know about Starlink satellite internet

  1. Open Twitter and login to your account.
  2. Open someone’s profile.
  3. Click on Followers and you’ll see the list of people who are following your chosen profile.
  4. Scroll down few times to load more profiles to the list.
  5. Press SHIFT + CTRL + I (Windows) or CMD + OPT + I (Mac) on your keyboard or right click anywhere on the browser and select “Inspect Element” or click on Chrome menu icon at the top-right corner of your browser window and then go to More tools > Developer Tools.
  6. Select the “Console” tab.
  7. Copy and paste the code below to console and press “Enter”.
let btns = document.querySelectorAll("[data-testid]")
let followBtns = Array.from(btns).filter(btn => {
    return btn.getAttribute('data-testid').includes('follow')
})

for (let i = 1; i <= followBtns.length; i++) {
    setTimeout(() => {
        followBtns[i - 1].click()
    }, 1000 * i);
}

Twitter mass unfollow script

To run Twitter mass unfollow script you have to use Chrome browser.

  1. Open Twitter and login to your account.
  2. Click on Following and you’ll see the list of people who you’re following.
  3. Scroll down few times to load more profiles to the list.
  4. Press SHIFT + CTRL + I (Windows) or CMD + OPT + I (Mac) on your keyboard or right click anywhere on the browser and select “Inspect Element” or click on Chrome menu icon at the top-right corner of your browser window and then go to More tools > Developer Tools
  5. Select the “Console” tab.

a. Unfollow those not following back

To unfollow all those people who are not following you back, then copy and paste the code below to console and press “Enter”.

var LANGUAGE = "EN"; //NOTE: change it to use your language!
var WORDS =
{
	//English language:
	EN:
	{
		followsYouText: "Follows you", //Text that informs that follows you.
		followingButtonText: "Following", //Text of the "Following" button.
		confirmationButtonText: "Unfollow" //Text of the confirmation button. I am not totally sure.
	},
	//Spanish language:
	ES:
	{
		followsYouText: "Te sigue", //Text that informs that follows you.
		followingButtonText: "Siguiendo", //Text of the "Following" button.
		confirmationButtonText: "Dejar de seguir" //Text of the confirmation button. I am not totally sure.
	}
	//NOTE: if needed, add your language here...
}
var UNFOLLOW_FOLLOWERS = false; //If set to true, it will also remove followers (unless they are skipped).
var MS_PER_CYCLE = 10; //Milliseconds per cycle (each call to 'performUnfollow').
var MAXIMUM_UNFOLLOW_ACTIONS_PER_CYCLE = null; //Maximum of unfollow actions to perform, per cycle (each call to 'performUnfollow'). Set to 'null' to have no limit.
var MAXIMUM_UNFOLLOW_ACTIONS_TOTAL = null; //Maximum of unfollow actions to perform, in total (among all calls to 'performUnfollow'). Set to 'null' to have no limit.
var SKIP_USERS = //Users that we do not want to unfollow (even if they are not following you back):
[
	//Place the user names that you want to skip here (they will not be unfollowed):
	"user_name_to_skip_example_1",
	"user_name_to_skip_example_2",
	"user_name_to_skip_example_3"
];
SKIP_USERS.forEach(function(value, index) { SKIP_USERS[index] = value.toLowerCase(); }); //Transforms all the user names to lower case as it will be case insensitive.

var _UNFOLLOWED_TOTAL = 0; //Keeps the number of total unfollow actions performed. Read-only (do not modify).

//Function that unfollows non-followers on Twitter:
var performUnfollow = function(followsYouText, followingButtonText, confirmationButtonText, unfollowFollowers, maximumUnfollowActionsPerCycle, maximumUnfollowActionsTotal)
{
	var unfollowed = 0;
	followsYouText = followsYouText || WORDS.EN.followsYouText; //Text that informs that follows you.
	followingButtonText = followingButtonText || WORDS.EN.followingButtonText; //Text of the "Following" button.
	confirmationButtonText = confirmationButtonText || WORDS.EN.confirmationButtonText; //Text of the confirmation button.
	unfollowFollowers = typeof(unfollowFollowers) === "undefined" || unfollowFollowers === null ? UNFOLLOW_FOLLOWERS : unfollowFollowers;
	maximumUnfollowActionsTotal = maximumUnfollowActionsTotal === null || !isNaN(parseInt(maximumUnfollowActionsTotal)) ? maximumUnfollowActionsTotal : MAXIMUM_UNFOLLOW_ACTIONS_TOTAL || null;
	maximumUnfollowActionsTotal = !isNaN(parseInt(maximumUnfollowActionsTotal)) ? parseInt(maximumUnfollowActionsTotal) : null;
	maximumUnfollowActionsPerCycle = maximumUnfollowActionsPerCycle === null || !isNaN(parseInt(maximumUnfollowActionsPerCycle)) ? maximumUnfollowActionsPerCycle : MAXIMUM_UNFOLLOW_ACTIONS_PER_CYCLE || null;
	maximumUnfollowActionsPerCycle = !isNaN(parseInt(maximumUnfollowActionsPerCycle)) ? parseInt(maximumUnfollowActionsPerCycle) : null;

	//Looks through all the containers of each user:
	var totalLimitReached = false;
	var localLimitReached = false;
	var userContainers = document.querySelectorAll('[data-testid=UserCell]');
	Array.prototype.filter.call
	(
		userContainers,
		function(userContainer)
		{
			//If we have reached a limit previously, exits silently:
			if (totalLimitReached || localLimitReached) { return; }
			//If we have reached the maximum desired number of total unfollow actions, exits:
			else if (maximumUnfollowActionsTotal !== null && _UNFOLLOWED_TOTAL >= maximumUnfollowActionsTotal) { console.log("Exiting! Limit of unfollow actions in total reached: " + maximumUnfollowActionsTotal); totalLimitReached = true; return;  }
			//...otherwise, if we have reached the maximum desired number of local unfollow actions, exits:
			else if (maximumUnfollowActionsPerCycle !== null && unfollowed >= maximumUnfollowActionsPerCycle) { console.log("Exiting! Limit of unfollow actions per cycle reached: " + maximumUnfollowActionsPerCycle); localLimitReached = true; return;  }

			//Checks whether the user is following you:
			if (!unfollowFollowers)
			{
				var followsYou = false;
				Array.from(userContainer.querySelectorAll("*")).find
				(
					function(element)
					{
						if (element.textContent === followsYouText) { followsYou = true; }
					}
				);
			}
			else { followsYou = false; } //If we want to also unfollow followers, we consider it is not a follower.

			//If the user is not following you (or we also want to unfollow followers):
			if (!followsYou)
			{
				//Finds the user name and checks whether we want to skip this user or not:
				var skipUser = false;
				var userName = "";
				Array.from(userContainer.querySelectorAll("[href^='/']")).find
				(
					function (element)
					{
						if (skipUser) { return; }
						if (element.href.indexOf("search?q=") !== -1 || element.href.indexOf("/") === -1) { return; }
						userName = element.href.substring(element.href.lastIndexOf("/") + 1).toLowerCase();
						Array.from(element.querySelectorAll("*")).find
						(
							function (subElement)
							{
								if (subElement.textContent.toLowerCase() === "@" + userName)
								{
									if (SKIP_USERS.indexOf(userName) !== -1)
									{
										console.log("We want to skip: " + userName);
										skipUser = true;
									}
								}
							}
						);
					}
				);

				//If we do not want to skip the user:
				if (!skipUser)
				{
					//Finds the unfollow button:
					Array.from(userContainer.querySelectorAll('[role=button]')).find
					(
						function(element)
						{
							//If the unfollow button is found, clicks it:
							if (element.textContent === followingButtonText)
							{
								console.log("* Unfollowing: " + userName);
								element.click();
								unfollowed++;
								_UNFOLLOWED_TOTAL++;
							}
						}
					);
				}
			}
		}
	);

	//If there is a confirmation dialog, press it automatically:
	Array.from(document.querySelectorAll('[role=button]')).find //Finds the confirmation button.
	(
		function(element)
		{
			//If the confirmation button is found, clicks it:
			if (element.textContent === confirmationButtonText)
			{
				element.click();
			}
		}
	);

	return totalLimitReached ? null : unfollowed; //If the total limit has been reached, returns null. Otherwise, returns the number of unfollowed people.
}


//Scrolls and unfollows non-followers, constantly:
var scrollAndUnfollow = function()
{
	window.scrollTo(0, document.body.scrollHeight);
	var unfollowed = performUnfollow(WORDS[LANGUAGE].followsYouText, WORDS[LANGUAGE].followingButtonText, WORDS[LANGUAGE].confirmationButtonText, UNFOLLOW_FOLLOWERS, MAXIMUM_UNFOLLOW_ACTIONS_PER_CYCLE, MAXIMUM_UNFOLLOW_ACTIONS_TOTAL); //For English, you can try to call it without parameters.
	if (unfollowed !== null) { setTimeout(scrollAndUnfollow, MS_PER_CYCLE); }
	else { console.log("Total desired of unfollow actions performed!"); }
};
scrollAndUnfollow();

b. Unfollow all

To unfollow all those people you’re following, then copy and paste the code below to console and press “Enter”.

(() => {
  const $followButtons = '[data-testid$="-unfollow"]';
  const $confirmButton = '[data-testid="confirmationSheetConfirm"]';

  const retry = {
    count: 0,
    limit: 3,
  };

  const scrollToTheBottom = () => window.scrollTo(0, document.body.scrollHeight);
  const retryLimitReached = () => retry.count === retry.limit;
  const addNewRetry = () => retry.count++;

  const sleep = ({ seconds }) =>
    new Promise((proceed) => {
      console.log(`WAITING FOR ${seconds} SECONDS...`);
      setTimeout(proceed, seconds * 1000);
    });

  const unfollowAll = async (followButtons) => {
    console.log(`UNFOLLOWING ${followButtons.length} USERS...`);
    await Promise.all(
      followButtons.map(async (followButton) => {
        followButton && followButton.click();
        await sleep({ seconds: 1 });
        const confirmButton = document.querySelector($confirmButton);
        confirmButton && confirmButton.click();
      })
    );
  };

  const nextBatch = async () => {
    scrollToTheBottom();
    await sleep({ seconds: 1 });

    const followButtons = Array.from(document.querySelectorAll($followButtons));
    const followButtonsWereFound = followButtons.length > 0;

    if (followButtonsWereFound) {
      await unfollowAll(followButtons);
      await sleep({ seconds: 2 });
      return nextBatch();
    } else {
      addNewRetry();
    }

    if (retryLimitReached()) {
      console.log(`NO ACCOUNTS FOUND, SO I THINK WE'RE DONE`);
      console.log(`RELOAD PAGE AND RE-RUN SCRIPT IF ANY WERE MISSED`);
    } else {
      await sleep({ seconds: 2 });
      return nextBatch();
    }
  };

  nextBatch();
})();
Tags: Twitter
Previous Post

Essential supplements for women

Next Post

How to disable PHP error logs

Victor Mochere

Victor Mochere

Blogger, internet personality, and netpreneur creating and marketing digital content.

Related Posts

Why Ezoic is better than Mediavine
Passé

Why Ezoic is better than Mediavine

How to predict forex movements
Finance

How to predict forex movements

How to become an M-Pesa agent
Business

How to become an M-Pesa agent

How to send money from M-Pesa to Airtel Money
Living

How to send money from M-Pesa to Airtel Money

Magic mushrooms: The future of mental health care
Living

Magic mushrooms: The future of mental health care

Best quotes from Serena Williams
Passé

Best quotes from Serena Williams

Next Post
How to disable PHP error logs

How to disable PHP error logs

Comments 4

  1. Anonymous says:
    4 years ago

    Thanks exactly what I was looking for.

    Reply
  2. I trump virus says:
    4 years ago

    This is great information. What is the daily unfollow number before you violate unfollow rules.

    Reply
  3. patweek says:
    4 years ago

    woW!

    Reply
  4. Bhadmus says:
    2 years ago

    Well done Victor! It worked. Any tips to unfollow inactive handles on Twitter? I mean handles who have not tweeted for let say 2years or more? I will appreciate your response. I will keep checking back.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Trending articles

  • My reflections, on this my birthday

    My reflections, on this my birthday

    1 shares
    Share 0 Tweet 0
  • My reflections on turning 30

    1 shares
    Share 0 Tweet 0
  • Top 10 greatest marathon runners of all time

    0 shares
    Share 0 Tweet 0
  • Evolution of self-driving technology

    1 shares
    Share 0 Tweet 0
  • Business practices that every entrepreneur must adopt

    1 shares
    Share 0 Tweet 0

Latest articles

The 20 largest floral tributes of all time
Living

The 20 largest floral tributes of all time

by Victor Mochere
0

Floral tributes have long served as a universal language of mourning, reverence, and collective memory. Yet, on rare occasions, grief...

Read moreDetails
How to build a hospital management software system

How to build a hospital management software system

How hospital management systems improve efficiency in healthcare delivery

How hospital management systems improve efficiency in healthcare delivery

Top 20 best defended countries in the world

Top 20 best defended countries in the world

How powerful is the Catholic Church?

How powerful is the Catholic Church?

Recommended articles

How to register an engineering consulting firm in Kenya
Living

How to register an engineering consulting firm in Kenya

by Victor Mochere
0

An engineering consulting firm is an entity that provides independent expertise in engineering, science and related areas to governments, industries,...

Read moreDetails

Bitter story of Mumias Sugar Company

Things to consider when choosing a product to sell online

How to make money on Twitter

Data protection rights in Kenya

Victor Mochere

Victor Mochere is one of the biggest informational blogs on the web. We publish well curated up-to-date facts and important updates from around the world.

Sections

  • Business
  • Education
  • Entertainment
  • Finance
  • Flacked
  • Governance
  • Living
  • Passé
  • Sports
  • Technology
  • Travel

Follow us

  • Advertise
  • Disclaimer
  • Cookies
  • Privacy Policy
  • Copyright
  • DMCA
  • Guest blogger
  • Blog tip
  • Contact us

© 2025 Victor Mochere. All rights reserved.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
[gtranslate]
No Result
View All Result
  • Login
  • Sections
    • Business
    • Finance
    • Education
    • Travel
    • Technology
    • Living
    • Entertainment
    • Governance
    • Sports
  • About us
  • Victor Mochere Biography
  • Sitemap
  • Social Media Policy
  • Corrections
  • Comment Policy

© 2025 Victor Mochere. All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Cookie Policy.