Ghost guide · Publishing platform

Marech for Ghost Blogs

Injected once into your theme, the snippet monitors every page and post — and a Cloudflare-fronted Ghost site can block scrapers at the edge too.

PlatformPublishing platformSetup~2 minutesBlockingSupported

How Marech protects a Ghost site

Ghost's Code injection drops the snippet into the <head> of every page and post, so monitoring is a single paste — no theme editing. Since long-form writing is exactly what AI crawlers want, blocking matters here: if your Ghost site is fronted by Cloudflare, a Worker can stop scrapers before they reach your content.

Mode 1

Monitoring — the snippet

One line of JavaScript in your <head>. It reports scraper traffic to your dashboard and overlays JS-running bots. Works on Ghost in ~2 minutes.

Mode 2

Blocking — the edge check

A server-side check (a Cloudflare Worker at the edge) returns a 403 to scrapers before your content is served — the only thing that stops non-JS scrapers.

Before you begin

You'll need a couple of things ready. The monitoring step needs only the first two.

  • A Marech account — start a free trial (no credit card).
  • Access to edit your Ghost site's theme, settings, or code.
1

Install the monitoring snippet

One line of JavaScript that reports scraper traffic to your dashboard. Works on every Ghost plan and takes about ~2 minutes.

GhostSettings → Advanced → Code injection → Site Header
1
Copy your Marech snippet
After signing up, open your Marech dashboard and click "Get Snippet Code". Copy the script tag.
2
Open Ghost Admin
Log in to your Ghost Admin panel (yourdomain.com/ghost).
3
Go to Settings → Code injection
In the left sidebar click Settings, then scroll to Advanced and open Code injection.
4
Paste into the Site Header field
Paste your Marech snippet into the Site Header box. This injects it into the <head> of every page and post.
5
Click Save
Hit Save. Monitoring is now live across your entire Ghost publication — scraper traffic will appear in your dashboard.
Verify monitoring is live
Open any post on your live site and check the dashboard feed. Site-header injection covers every page automatically, so you never need to touch individual templates or the theme.
Monitoring vs. blocking — the honest version
The snippet above reports traffic and overlays JS-running bots — but non-JS scrapers (curl, python-requests, GPTBot…) download your HTML directly and never run it, so it can't block those. Ghost's Code injection only lets you add the monitoring snippet. To actually block non-JS scrapers, front your Ghost site with Cloudflare and run the BlockMe Worker at the edge — it checks each request before it reaches Ghost. Full details in the integration guide.
2

Turn on real blocking (optional)

Stops non-JS scrapers before your content is served, using a Cloudflare Worker at the edge. Needs a Marech API key and a block policy.

1
Route your domain through Cloudflare
Add your custom domain to Cloudflare and set your Ghost DNS records to Proxied (orange cloud) so requests pass through Cloudflare's edge first.
2
Create an API key and a block policy
In the Marech dashboard, create an API key (shown once — copy it) and add a block policy (e.g. bot types scraper and ai_tool).
3
Deploy the BlockMe Cloudflare Worker
Follow the Cloudflare integration guide to deploy the Worker with your API key and API URL, routed to your domain. Scrapers get a 403 before reaching Ghost; it fails open on any outage.

Verify it's blocking. With the Worker live, a fake GPTBot request returns a 403 while a real reader loads your post normally.

verify blocking
curl -A "GPTBot/1.0" -I https://yourblog.com/

Troubleshooting & FAQ

Does this work on Ghost(Pro) as well as self-hosted?
Monitoring works on both — Code injection is a standard Ghost feature. Edge blocking needs Cloudflare in front of your domain, which works with a self-hosted Ghost install or any Ghost(Pro) site on a custom domain you manage the DNS for.
Will it interfere with members or subscriptions?
No. The snippet is passive analytics, and the edge Worker only blocks scraper user-agents — signed-in members and normal readers pass straight through.
Does the snippet slow down my site?
No. The script is tiny and loads asynchronously, so it never blocks your page from rendering. Server-side blocking adds a single fast check in front of your origin and fails open, so it can't slow down or take down your site.
Will it block real visitors or hurt SEO?
No. Marech targets automated scrapers, not people, and search engines you care about are allowed by default — you decide exactly what gets blocked with policies. See how detection works.

Next steps

Ready to protect your Ghost site?

Free 7-day trial. No credit card required.