Auto‑Translate Ghost Blog Posts to 8 Languages for SEO
Published on SiteLocaleAI Blog
International traffic is the holy grail for any content‑driven site. Ghost makes publishing a breeze, but it doesn’t provide out‑of‑the‑box multilingual SEO. In this use‑case guide we’ll show how to combine Ghost with SiteLocaleAI to automatically generate SEO‑indexed versions of each post in eight languages, complete with price localization and pre‑rendered HTML for crawlers.
1. Overview of the workflow
- Write a post in English (or your source language) in Ghost.
- Trigger a webhook after the post is published.
- SiteLocaleAI’s Node CLI calls your LLM API (Claude, GPT‑4o‑mini, etc.) to translate the content and apply psychological price rounding.
- Generate static HTML for each language using the SEO pre‑render CLI.
- Deploy the files to your static host (Netlify, Vercel, Cloudflare Pages, etc.) or serve them via Ghost’s custom routes.
The result: eight fully indexed pages that appear in Google’s “language‑specific” results, driving organic traffic from Europe, Asia, and the Americas.
2. Prerequisites
| Item | Why you need it |
|---|---|
| Ghost (≥4.0) | Source CMS for posts |
| Node ≥18 | Runs SiteLocaleAI CLI |
| LLM API key (Claude, GPT‑4o‑mini, etc.) | Powers translation |
| Git repo or static host | Stores the pre‑rendered pages |
| Optional: Docker | Isolates the CLI environment |
Make sure your Ghost installation has Webhooks enabled (Settings → Integrations → Webhooks).
3. Install SiteLocaleAI locally
# Clone the repo (or npm install the library)
git clone https://github.com/sitelocaleai/site-locale-js.git
cd site-locale-js
# Install dependencies
npm ci
# Install the CLI globally for convenience
npm i -g @sitelocaleai/cli
The library is framework‑agnostic, so it works with Ghost’s Handlebars templates without any extra bundling.
4. Configure the translation service
Create a .env file in the project root:
LLM_API_KEY=sk-xxxxxxxxxxxxxxxxxxxx
LLM_PROVIDER=claude # or openai, gemini, etc.
TARGET_LANGUAGES=es,fr,de,it,pt,ja,zh,ru
DEFAULT_CURRENCY=USD
The TARGET_LANGUAGES list can be any ISO‑639‑1 codes supported by your LLM. SiteLocaleAI will automatically apply psychological rounding (e.g., €9.99 → €9.95) based on the currency of each locale.
5. Set up the Ghost webhook
- In Ghost Admin, go to Settings → Integrations → Webhooks.
- Create a new webhook:
- Event:
post.published - URL:
https://your‑server.com/api/translate - Method:
POST
- Event:
- Save the webhook.
Your server will receive a payload like:
{
"post": {
"id": "12345",
"title": "How to Brew the Perfect Coffee",
"html": "<p>...content...</p>"
}
}
6. Build a tiny translation endpoint
Below is a minimal Express server that forwards the payload to SiteLocaleAI’s CLI.
// server.js
require('dotenv').config();
const express = require('express');
const { exec } = require('child_process');
const app = express();
app.use(express.json());
app.post('/api/translate', (req, res) => {
const { post } = req.body;
if (!post) return res.status(400).send('Missing post');
// Write the post to a temporary file for the CLI
const fs = require('fs');
const tmpPath = `/tmp/post-${post.id}.json`;
fs.writeFileSync(tmpPath, JSON.stringify(post));
// Run the CLI – it will create a folder `dist/<lang>/<slug>.html`
const cmd = `sitelocaleai translate --input ${tmpPath} --output ./dist`;
exec(cmd, (err, stdout, stderr) => {
if (err) {
console.error(stderr);
return res.status(500).send('Translation failed');
}
console.log(stdout);
res.send('Translation started');
});
});
app.listen(3000, () => console.log('⚡️ Server listening on :3000'));
Deploy this server (Heroku, Railway, Fly.io, etc.) and point the Ghost webhook to it.
7. Pre‑render for SEO
SiteLocaleAI ships a CLI pre‑renderer that crawls the generated HTML and produces static files that search engines can index.
# From the project root after translations are done
sitelocaleai prerender \
--src ./dist \
--out ./public \
--base-url https://your‑site.com
The command:
- Resolves internal links (e.g.,
/about→/es/about). - Injects
<link rel="alternate" hreflang="...">tags. - Generates a sitemap (
sitemap.xml) with entries for each language.
You can now push the public folder to your static host. Google will crawl the pre‑rendered pages and index them under the correct language,.
8. Verify SEO signals
- Fetch as Google – use Search Console’s URL Inspection tool on
https://your‑site.com/es/how-to-brew-the-perfect-coffee. - Check hreflang – view source and confirm the
<link rel="alternate" hreflang="es" …>tags. - Price localization – ensure prices appear as
€9.95(Spain) and¥1,200(Japan) with psychological rounding.
9. Automate the pipeline (optional)
Add a GitHub Action that runs the pre‑renderer after each push to main:
name: Deploy SEO Pages
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm run build # your Ghost build step
- run: sitelocaleai prerender --src ./dist --out ./public --base-url https://your‑site.com
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2
with:
publish-dir: ./public
production-branch: main
Now every new Ghost post automatically triggers the whole translation‑to‑SEO flow.
10. Internal resources
- Detailed quick‑start guide: https://sitelocaleai.com/docs/quick-start
- How the SEO pre‑renderer works: https://sitelocaleai.com/docs/seo-pre-render
11. Wrap‑up
By wiring Ghost to SiteLocaleAI you get:
- Eight language versions of every post without manual effort.
- Search‑engine‑friendly static HTML that respects hreflang and sitemaps.
- Localized pricing that feels natural to each market.
- Zero extra cost beyond your LLM usage – the library runs on your own infrastructure.
Ready to turn your Ghost blog into a global traffic magnet? Try SiteLocaleAI today and watch your international SEO soar.