Skip to content
a little command line script to help you block people on Mastodon
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mastodon Blocker

This tool allows you to mass-block people on Mastodon. This is an emergency tool when you're being harassed by a mob. It helps to block people faster. Ideally, they are blocked before they even harass you. And yes, innocent people will get caught up in this. But when you're being harassed by a mob, maybe that's the kind of trade-off you're willing to make.

My hope is that something like this eventually makes it into all the Mastodon clients, and into the Mastodon web UI and the Mastodon client API (in order to make it easy to use). For more discussion, see issue #8680, "Chain Blocking."

Table of Contents


Here's how it works. You need Python 3 and you need the library installed.

pip3 install

Copy the script and make it executable:

curl > mastodon-blocker
chmod +x mastodon-blocker

(Please help me improve this process?)

Using it

Start the tool with your account:


If you haven't authorized it, now's the time to do it. It prints a URL which you need to visit, authorize the app, copy the authorization code and paste it.

Registering app...
This app needs access to your Mastodon account.
Visit the following URL and authorize the app:
[it prints a long URL]
Then paste the access token here:
[you paste a long code]
Verifying the code...
Logging in...
Load the current blocks...
64 people already blocked

Now you're ready! This is the prompt:


Copy and paste a URL to a toot. You get this URL right-click on the timestamp of a toot. In the Mastodon web user-interface, that's either the time elapsed in the top-right corner or the date in the bottom-left corner:

time elapsed


Or you can also take the URL of your browser if you've clicked on the toot. It's all good. All we care about is the number, the id. Either of these two formats will do:

Here's an example:

Processing 100719476477868576
1 people favourited this toot
0 people boosted this toot

And what happens if you do it again? Nothing!

Processing 100719476477868576
1 people favourited this toot
0 people boosted this toot is already blocked

Keep repeating this for every toot you see.

That's it! Stay safe. May you never be harassed by the mob.


There's a web app that does a similar thing:

You can’t perform that action at this time.