If you have blocked hundreds of accounts, unblocking them one by one takes a lot of time. But there is a quick and easy way to unblock them all at once. You don’t need to give any app write permissions to your account for it to work.
Got to the blocked accounts setting page, scroll to the bottom and run
in the browser console.
1. Go to the settings
On this page you see all accounts your are blocking at the moment:
2. Open the Developer Tools
Quickest way: Press F12 on Windows/Linux or Command+Option+I on MacOS. Tested on Chrome and Firefox.
You can go through the menu as well. Firefox: Extras -> Web Developers. Chrome: Other Tools -> Developer Tools.
3. Open the Browser Console
4. Scroll to the bottom of the page
The command we will use to unblock all accounts only unblocks accounts, that are loaded on the page. Therefore we need to scroll to the bottom so Twitter loads all accounts. You can do that manually by holding the scroll bar to the bottom or you can use the following two commands.
Start automated scrolling:
var autoScroll = setInterval(() => window.scrollTo(0, document.body.scrollHeight),1000);
‘setIntervall’ executes the function we give it every 1000 milliseconds. windows.scrollTo scrolls to the end of the page. If the page got longer the next time (after 1 second) the command is executed, it will scroll further.
Stop automated scrolling:
Once we reached the bottom, we want to stop the scrolling.
5. Unblock all accounts
Explanation of the code:
('.user-actions-follow-button') selects all Elements with the class “user-actions-follow-button”. While the class refers to following, Twitter uses it for the unblock button as well. You can see this yourself, when you use the element selector. The class stays the same after unblocking and the buttons change into follow buttons. If you would run the command again, it would follow all accounts.
.click() clicks on all elements that were selected.
If you leave the
.click(), you can see how many accounts it would unfollow. You can add
.length instead to get a cleaner output. In my case it would be 3 accounts.
If you have an questions feel free to leave a comment or ask me on Twitter.
I unblocked all 390 accounts I blocked over the last 10 years.
Code I used on the block page: $('.user-actions-follow-button').click() pic.twitter.com/ics5zLlcUe
— Luca Hammer (@luca) April 28, 2017