Twitter recently rolled out a redesign of their desktop website interface, and the ability to export and import my block list seems to have been removed. Exporting/importing my block list was useful in archiving or sharing (with my other accounts, or with others' accounts).

Previously, I could view my block list by clicking "Settings and privacy -> Blocked accounts", which led to https://twitter.com/settings/blocked. There was a dropdown-link labeled "Advanced options" that revealed an option to "Export your list", which downloaded as a CSV file of a single column of many numbers (presumably user IDs).

old screenshot

In the new (2019) Twitter interface, I can view my block list by clicking "Settings -> Privacy and safety -> Blocked accounts", which leads to https://twitter.com/settings/blocked/all. There is no tool I see for exporting or importing my block list, only to view all or view imported.

new screenshot

I don't see this data in Twitter's "Settings -> Account -> Your Twitter data" download either.

Navigating to the old URL takes me to the new URL.

Anyone know a way to export my personal block list from Twitter now?

3 Answers 3


This facility is "not currently available", unfortunately. Maybe keep an eye on this page:



The way I did it wasn't pretty, but they severely limited our options by removing the export/import block list functionality.

I requested my Data Archive (https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive). You'll notice that it only contains link out to the web version of the block list. Since that list is dynamically loaded, it is not easy to web scrape without Selenium or a proxy, and it will get ugly.

So, instead, I dug around in the Data Archive and eventually found block.js, which is a JSON object of all the blocked accounts in their ideas. From there you can write a quick Python script to use the Twitter API to resolve all of those IDs to usernames.

Once I get home I'll edit this comment to include the Python I used for this.

EDIT: Here is the script:

// Burninator 2022 // Export block list functionality that Twitter randomly removed // Used to block all the promoted content, will be posting a list of about 5000 blocked accounts shortly

from requests_oauthlib import OAuth1Session
import os
import json
import time

def getblocklist(fancyfile):
    consumer_key = "HAHA"
    consumer_secret = "NICETRYHACKERS"

    # Get request token
    request_token_url = "https://api.twitter.com/oauth/request_token?oauth_callback=oob&x_auth_access_type=write"
    oauth = OAuth1Session(consumer_key, client_secret=consumer_secret)

        fetch_response = oauth.fetch_request_token(request_token_url)
    except ValueError:
            "There may have been an issue with the consumer_key or consumer_secret you entered."

    resource_owner_key = fetch_response.get("oauth_token")
    resource_owner_secret = fetch_response.get("oauth_token_secret")
    print("Got OAuth token: %s" % resource_owner_key)

    # Get authorization
    base_authorization_url = "https://api.twitter.com/oauth/authorize"
    authorization_url = oauth.authorization_url(base_authorization_url)
    print("Please go here and authorize: %s" % authorization_url)
    verifier = input("Paste the PIN here: ")

    # Get the access token
    access_token_url = "https://api.twitter.com/oauth/access_token"
    oauth = OAuth1Session(
    oauth_tokens = oauth.fetch_access_token(access_token_url)

    access_token = oauth_tokens["oauth_token"]
    access_token_secret = oauth_tokens["oauth_token_secret"]

    # Make the request
    oauth = OAuth1Session(

    logMe = open(fancyfile, 'r') #Block.js from user's data archive download
    leoutput = open("block_names.txt", 'a') #save account names here
    thecounter = 1

    for line in logMe:
        thatsTheTweet = "Current blocked account ID: " + line
        line = line.strip()
        thecounter = thecounter + 1

        # Making the request
        response = oauth.get(

        #print (str(response.content))
        if (response.status_code != 201) and (response.status_code != 200):
            print("Request returned an error: {} {}".format(response.status_code, response.text))

        if ("Not Found Error" in response.text):
            print("Response code User Not Found: {}".format(response.status_code))

        if ("Forbidden" in response.text):
            print("Response code Forbidden: {}".format(response.status_code))

        if response.status_code == 429:
            print("Response code 429 usually is rate limit: {}".format(response.status_code))

        print("Response code: {}".format(response.status_code))

        # Saving the response as JSON
        json_response = response.json()
        print(json.dumps(json_response, indent=4, sort_keys=True))

        snarf= json.dumps(json_response, indent=4, sort_keys=True)
        thejson = json.loads(snarf)
        writeme = thejson['data']['username'] #     "data" "username"

        if (thecounter < 200):
            time.sleep(20)  # make it 20, 38 wroks


if __name__ == '__main__':


  • Thanks for including the link to your code. Would you please add the code to your answer. Regrettably, external resources sometimes become unreachable or go permanently offline. The link is helpful, but it's always better to include as much information in your answer, and avoid making it necessary to click on links as much as possible.
    – Tedinoz
    Jul 27, 2022 at 10:49
  • No problem, thanks for the head's up, I'll add it now
    – burninator
    Jul 27, 2022 at 19:21

The feature is still available, though unofficially. Just set up a browser extension switching Twitter to the pre-2019 design:

...and the Import/Export is still there as it was.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.