💡
In v5.109.0, Ghost added a new admin setting so you can easily block domains from your Ghost dashboard.
Go to Settings > Advanced > Spam filters.
The post below explains more technical methods to accomplish the same thing, using the config file and command line.

In v5.108.1, Ghost added a new spam setting that can block email addresses from specific domains signing up to your site as members.

This new setting is spam.blocked_email_domains.

Manually edit the config file

You can manually edit this setting in your config.production.json file.

Open the file on your server (for example with sudo nano config.production.json ) and scroll down to the bottom of the file. Before the ending }, paste in this JSON:

  "spam": {
    "blocked_email_domains": [
      "tmomail.net",
      "txt.bell.ca",
      "txt.att.net"
    ]
  }
👉
Make sure to add a comma on the line before the "spam: {" line so your file is valid JSON.

The list of domains above is recommended based on this post on the Ghost forum and my own sites' signups.

Use the command line

If you'd rather edit the config file using Ghost CLI, you can use the jq command line processor to add a list of domains to your JSON file.

Unfortunately the Ghost CLI doesn't support adding lists of values very well so we need to use a tool to make it work.

First install jq:

# Ubuntu
sudo apt-get install jq

# Mac
brew install jq

Then run this command. It will create the spam.blocked_email_domains key if it doesn't exist already. If it does exist already, any domains you add to the command will be added to your existing settings.

jq 'if .spam.blocked_email_domains then .spam.blocked_email_domains += ["tmomail.net", "txt.bell.ca" "txt.att.net"] else .spam.blocked_email_domains = ["tmomail.net", "txt.bell.ca" "txt.att.net"] end' config.production.json > config.production.tmp.json && mv config.production.tmp.json config.production.json

Feel free to edit the list of domains. Just make sure that it is valid JSON, with the correct [ and " characters surrounding the domains, as above.

Thanks for reading!

Dan Rowden   Dan Rowden

I am the creator of Codelet. I have published and developed on Ghost for +5 years, on over 100 sites.

Get one-on-one Ghost support from me