How to add an AI chatbot to a Ghost site

In Ghost Admin, open Settings → Code injection, paste the Feedbot script into Site footer and save. The chatbot appears on every page of your publication and answers readers from your posts and help pages.

  • Setup: 5 minutes
  • Free plan, no card
  • Updated

Ghost is built for publishing, not for support, so reader questions about subscriptions, sponsorships or past articles usually land in your inbox. A chatbot can answer the repeat ones from your own posts and pages. Here’s how to add Feedbot (we make it) to Ghost.

What you need

  • A Feedbot bot id from Dashboard → Bot → Install. The Free plan is enough to start.
  • Owner or Administrator access to Ghost Admin.
  • Any Ghost(Pro) plan or a self-hosted Ghost install. Code injection is available on both.

Add the chatbot to every page

  1. Sign in to Ghost Admin (yoursite.com/ghost).

  2. Click the Settings gear in the bottom-left corner.

  3. In the Advanced section, find Code injection and click Open.

  4. Paste this into Site footer:

    <script src="https://w.feedbotai.com/v1/feedbot.js" data-bot-id="YOUR_BOT_ID" async></script>
  5. Click Save and open your site in a new tab. The chat button appears in the bottom-right corner.

Ghost places Site footer code just before the closing </body> tag on every page, which is where scripts belong. Ghost’s own guide to code injection covers the same screen.

If Portal’s Account or Subscribe button also sits in the bottom-right corner, move the chat to the left so they don’t overlap: add data-position="bottom-left" to the script tag, or change the position in the Feedbot dashboard.

Show it on some pages only

Goal How
One post or page only Open the post in the editor, click the settings icon (top right), open Code injection and paste the script into Post footer. Leave Site footer empty.
Every page except some Use the conditional snippet below in Site footer.
<script>
// Skip the chat on the homepage and on /tag/ archives.
if (location.pathname !== "/" && !location.pathname.startsWith("/tag/")) {
var s = document.createElement("script");
s.src = "https://w.feedbotai.com/v1/feedbot.js";
s.async = true;
s.dataset.botId = "YOUR_BOT_ID";
document.body.appendChild(s);
}
</script>

Pass member details (optional)

Code injection doesn’t process Handlebars, so it can’t read who is signed in. Your theme can. Ghost themes expose an @member object with email, name, uuid and paid. Add this to default.hbs, before {{ghost_foot}}:

{{#if @member}}
<script>
window.Feedbot = window.Feedbot || function () { (Feedbot.q = Feedbot.q || []).push(arguments) };
Feedbot("identify", {
email: "{{@member.email}}",
name: "{{@member.name}}",
metadata: { paid: {{#if @member.paid}}true{{else}}false{{/if}} }
});
</script>
{{/if}}

Two caveats. First, editing default.hbs means uploading a custom or modified theme, which on Ghost(Pro) needs a plan that allows custom themes (pricing). Second, Ghost has no place to compute the server-side hash Feedbot uses for verification, so these members stay unverified: the bot sees their name, email and paid status, but they don’t get chat history across devices. That’s enough for “I’m a paid member and can’t log in” conversations. See Identify users.

Troubleshooting

Symptom Cause Fix
No chat button after saving Browser or CDN cache Hard-refresh, or open the site in a private window.
Button hidden behind the Portal button Both in the bottom-right corner Add data-position="bottom-left" to the script tag, or change the position in the Feedbot dashboard.
Script shows as text on the page Pasted into a post body instead of Code injection Remove it from the post and use Site footer or Post footer.
Requests rejected Domain not in Allowed domains Add your Ghost domain (and the ghost.io subdomain if you use it) in Bot → Install → Allowed domains.
Member name shows &#x27; Handlebars escapes quotes in names Cosmetic. Use {{@member.firstname}} or leave the name out.

Train it on your posts

From Starter, add your site in Bot → Knowledge as a website source, or use https://yoursite.com/sitemap.xml to import the pages Ghost lists there. Click Refresh website after you publish new posts; sites aren’t re-crawled automatically. Put membership prices and support contacts in the business profile so the bot always knows them. Details: knowledge base.

When a reader asks for a person, the bot hands the conversation to you in Telegram, Slack, Discord or email (handoff), and readers who leave an email show up as leads.

Next steps

Questions

Can't find an answer? Ask the bot in the corner, or write to us.

Can I add a chatbot to Ghost without a custom theme?

Yes. Code injection works with any theme, including the official ones. Paste the script into Site footer under Settings → Code injection and save.

Does Ghost have a built-in chatbot?

No. Ghost has comments, newsletters and Portal for memberships, but no chat. You add one with a third-party script through Code injection.

Will the chatbot slow down my Ghost site?

The loader is about 6 KB gzipped, loads asynchronously and fetches the chat only when the reader hovers or clicks the button, or when the browser is idle.

Can the chatbot answer from my Ghost posts?

Yes, from the Starter plan: import your site by URL or by its sitemap.xml, which Ghost generates at /sitemap.xml. On the Free plan you add text and FAQ by hand.

Can the bot know which member is chatting?

It can, if you edit your theme to pass @member.email and @member.name to the widget. On Ghost(Pro) that needs a plan that allows custom themes. Ghost has no server hook for a verification hash, so these members stay unverified.

Keep exploring

Put one agent on your site today

Start on the free plan. Upgrade when conversations grow.