# Validate Ghost Members’ Emails: Setup Guide

URL: https://email-validation.org/docs/guides/ghost/
Updated: 2026-12-04

> Documentation index: https://email-validation.org/llms.txt

Check the email addresses of your Ghost site's members and give each member one label for its result, so you can
filter them in Ghost Admin, act on them in bulk, or send a post only to the members that passed. Two pieces, use
either or both: a script you run on your own computer checks the members you have as one bulk list, and a small
relay you deploy to your own Cloudflare account checks each new member, and each changed address, soon after. Neither
one deletes a member or sends an email. Both are in
[email-validation-ghost.zip](https://email-validation.org/downloads/ghost/email-validation-ghost.zip): `ghost.mjs` (the script), `relay.mjs` (the
relay), `webhook.json` and the MIT licence.

Ghost has no hook before a sign-up: its webhooks fire after Ghost has saved a member. So this cleans up after
sign-ups; it never refuses or slows down one.

## Your Ghost Admin API key

It needs Ghost 5 or 6, self-hosted, or Ghost(Pro) on Publisher, Business or Custom (Ghost's Starter plan has no
custom integrations, Admin API or webhooks). In Ghost Admin, open **Settings → Advanced → Integrations → Add custom
integration** and name it, say, "email-validation.org". Copy its **Admin API key** and your site's admin URL (such as
`https://example.ghost.io`). The key has full admin access to your site's content and members, so keep it secret: it
never leaves your computer or your Worker, and is used only to sign a short-lived token for each request to your site.

## What it writes

| Label | The address is |
|---|---|
| `ev-valid` | `valid`, and the action is `send` or `send_with_caution` |
| `ev-valid-remove` | `valid`, but the action is `remove`: a spam trap or a frequent complainer; do not send to it |
| `ev-invalid` | `invalid`: no such mailbox or domain, or malformed |
| `ev-catch-all` | `catch_all`: on a domain that accepts every address |
| `ev-unknown` | `unknown`: not settled this time, checked again later |
| `ev-disposable` | `disposable`: a throwaway address |

A member holds one of these labels at a time: when its address is checked again with another result, the old one is
replaced. Every other label of the member's stays as it is. `--label-prefix` (and the relay's `EV_LABEL_PREFIX`)
changes the `ev-` prefix. In Ghost Admin you can then filter your members by label, act on the filtered members in
bulk (for example unsubscribe them from email), or send a post to the members with a label, such as `ev-valid`.
Ghost's docs show no way to leave a label out of a send: to keep the bad addresses out of your newsletters,
unsubscribe them, or send to `ev-valid`, which no spam trap or complainer holds.

## Run the script

It needs Node 22.18 or later (nothing to install: it has no dependencies), an API key of ours from the
[API keys page](https://email-validation.org/app/api-keys/) with the permission **Bulk lists** (off by default: turn it on when you create the
key), and the Ghost Admin API key above.

Try it free first, on a test member: in Ghost Admin, open **Members → New member** (never your site's sign-up form,
which emails a sign-in link; Ghost's help describes its welcome emails as sent to members who sign up on your site).
Give it the address `no_mailbox@sandbox.email-validation.org` and the label `email-check-test`, switch every
newsletter off, and send it nothing: it is a test address, free, and it receives no mail. Then run the script on that
label only:

```bash
cd email-validation-ghost                                 # the unzipped folder
export EV_API_KEY=…  GHOST_ADMIN_API_URL=https://example.ghost.io  GHOST_ADMIN_API_KEY=…
node ghost.mjs --filter 'label:email-check-test' --dry-run   # must count 1 member
node ghost.mjs --filter 'label:email-check-test'             # the test member gets ev-invalid
```

In Windows PowerShell (5.1 or 7):

```powershell
cd email-validation-ghost                                 # the unzipped folder
$env:EV_API_KEY = "…"; $env:GHOST_ADMIN_API_URL = "https://example.ghost.io"; $env:GHOST_ADMIN_API_KEY = "…"
node ghost.mjs --filter 'label:email-check-test' --dry-run   # must count 1 member
node ghost.mjs --filter 'label:email-check-test'             # the test member gets ev-invalid
```

Never try it without the filter: a run without one checks, and pays for, every member without a result. Then delete
the test member, and run it on your real members, `--dry-run` first:

```bash
node ghost.mjs --dry-run                                  # counts what it would check; spends and writes nothing
node ghost.mjs                                            # checks and labels
```

- `--filter NQL` checks only the members a Ghost filter matches (for example `status:free`, or `label:<slug>`).
- `--unsubscribe invalid,disposable,valid_remove` also unsubscribes those **free** members from every newsletter
  (`valid_remove` names the `ev-valid-remove` members; `valid` is refused). A result `unknown` with the reason
  `timeout` or `internal_error` never unsubscribes anyone, even with `unknown` named: that check failed on our side,
  and the member is checked again later. Paid, comped and gift members only ever get our label.
- `--revalidate` checks members whose address was checked before; `--region eu` checks and keeps the list in the EU,
  with the same key.
- Running the relay too? Add `--with-relay`, so an address the relay already checked is not checked (and paid) again.

The script does not ask before it spends: each distinct address uses one credit; `unknown` results, duplicates,
malformed and test addresses are free. It prints member ids, job ids and counts, never an address or a key. It never
deletes a member or a label, never changes an address, a name, a tier or a subscription, and never sends an email. If
Ghost ever answers a member without its labels, it stops and writes nothing.

### Run it again

Run the same command again after any stop (no credits, a closed laptop, a Ghost outage, a regenerated key, the bulk
list still running): it resumes the same bulk list and never pays twice (within the 30 days a
list is kept). Run it from the same folder each time (or pass the same `--state FILE` and `--marks FILE`): the files
it keeps there hold the bulk list it is working on and a hash of each address it checked, never an address or a key.
An address it checked is not checked again unless it changes, so you can run it on a schedule, for example daily with
cron.

Ghost publishes no limit for its Admin API. The script sends 300 requests a minute by default (`--rate N`, at most
600; lower it for a small self-hosted server), and writing back takes two or three requests per member. The check
itself runs on our side and is not slowed by Ghost.

Exit codes: `0` done, `1` a write failed or the run stopped (run it again), `2` wrong arguments, `75` the bulk list
was still running when the script stopped waiting (run it again later).

## Check new members as they join

The relay is a Cloudflare Worker in your own account. It needs an API key of ours with **Validate addresses** (on by
default), your site's admin URL and Admin API key, and a Secret you choose for the webhooks: 16 to 256 printable
characters, no spaces. No terminal? [Deploy it from the Cloudflare dashboard](#relay-dashboard) instead. Or deploy it
from the unzipped folder:

```bash
npx wrangler deploy relay.mjs --name ev-ghost-relay --compatibility-date 2026-10-01
npx wrangler secret put EV_API_KEY --name ev-ghost-relay            # our API key
npx wrangler secret put GHOST_ADMIN_API_URL --name ev-ghost-relay   # your site's admin URL
npx wrangler secret put GHOST_ADMIN_API_KEY --name ev-ghost-relay   # the Admin API key
npx wrangler secret put GHOST_WEBHOOK_SECRET --name ev-ghost-relay  # the webhooks' Secret
```

Add `--var EV_REGION:eu` to the deploy command to have addresses validated in the EU and their results stored there.
`EV_LABEL_PREFIX` and `EV_UNSUBSCRIBE_STATUSES` work as the script's `--label-prefix` and `--unsubscribe`.

Then, in the same custom integration in Ghost Admin, add two webhooks, both with the relay's address and **the same
Secret** as `GHOST_WEBHOOK_SECRET` (`webhook.json` lists the two):

| Event | Target URL |
|---|---|
| Member added | `https://ev-ghost-relay.<your-subdomain>.workers.dev/?event=member.added` |
| Member updated | `https://ev-ghost-relay.<your-subdomain>.workers.dev/?event=member.edited` |

The relay checks a member when it is added, and again only when its address changes: its own label write never
causes a second check.

### Deploy the relay from the Cloudflare dashboard

1. In the [Cloudflare dashboard](https://dash.cloudflare.com/), open **Workers & Pages → Create** and choose
   **Create Worker** (the "Hello World" starter). Name it `ev-ghost-relay` and select **Deploy**.
2. Select **Edit code**, delete the starter code, paste the whole of `relay.mjs` from the box below (**Copy** takes
   all of it) and select **Deploy**.
3. In the Worker's **Settings → Variables and Secrets**, select **Add** for each value below, then **Deploy**:
   - type **Secret**: `EV_API_KEY` (our API key), `GHOST_ADMIN_API_URL` (your site's admin URL),
     `GHOST_ADMIN_API_KEY` (the Admin API key) and `GHOST_WEBHOOK_SECRET` (the webhooks' Secret);
   - type **Text**, if you want them: `EV_REGION` = `eu`, `EV_LABEL_PREFIX`, `EV_UNSUBSCRIBE_STATUSES`.
4. The relay's address, such as `https://ev-ghost-relay.<your-subdomain>.workers.dev/`, is on the Worker's page: use
   it in the two webhooks' Target URL, with its `?event=` as above.

Open [relay.mjs as plain text](https://email-validation.org/downloads/ghost/relay.mjs.txt), select all of it and copy it.

### Who can call the relay

Ghost signs every delivery with the webhooks' Secret, and the relay acts only on deliveries signed with it in the last
5 minutes; an unsigned delivery is refused. It reads the member itself with your key. A large import
reaches the relay as many deliveries: **after an import, run the script**, which checks the members the relay did not.

Try it once: add a test member as above, with another test address, `no_dns@sandbox.email-validation.org` (a member
the script already checked proves nothing). Within a few seconds it should hold the label `ev-invalid`. Then delete
it. From then on every new member and every changed address is a paid check, one credit each.

## Good to know

- **Ending the access.** Delete the two webhooks and the custom integration in Ghost Admin (**Settings → Advanced →
  Integrations**), and the relay's Worker.
- **Free checks.** Results with the status `unknown` are free, and so are malformed addresses, duplicates and test
  addresses.

## More on Ghost

- [Ghost email validation integration](https://email-validation.org/integrations/ghost/)
