✍️ AI Blog Engine for WordPress — n8n Workflow

One keyword in. A researched, internally-linked, SEO-graded WordPress draft out — with tags, category, excerpt and a featured image already attached.A single n8n workflow that researches live Google results for your keyword, plans an outline, writes the article section by section, links it to your own pages, grades itself against a 100-point SEO checklist, fixes what it scored badly on, and publishes the result to WordPress as a draft.Not "generate 1500 words about X." A pipeline where every step has one job and the output of each is checked before it moves on.Why this existsMost AI blog automations are one giant prompt: keyword → article → publish. You get a wall of generic text, invented statistics, zero internal links, no category, no tags, and no idea whether it's actually optimised for anything.This one splits the job into the steps a real SEO writer takes:Keyword strategy → live SERP research → outline with keyword assignments → section-by-section writing → editing and internal linking → scoring → revision → metadata → publish.Each section is written on its own, with its own assigned keywords and its own questions to answer. Nothing writes 1200 words in a single breath.What you getOne file to import. No sub-workflows to wire together.How it works1 · TriggerA built-in n8n Form — keyword, word count, number of sections, writing style, your site URL, and a description of your site and audience. Open the URL, fill it in, done. No setup beyond credentials.An optional Google Sheets queue (disabled by default) runs it on a daily schedule instead: one row per planned post, marked created=yes with its score and live URL when finished.2 · SEO research — with real sources Keyword Strategy turns your keyword into a plan: search intent, content type, content angle, 3 secondary + 5 long-tail + 5 semantic keywords. SERP Research runs on perplexity/sonar — a live-search model. It reports what actually ranks today, 5 real questions searchers ask, answers with real source URLs, and the gaps your article can fill. A normaliser turns all of it into one clean seoContext object the rest of the workflow reads from. The sources matter: every factual claim in the finished article carries a citation link back to a URL the research step actually retrieved. The writers are explicitly forbidden from inventing URLs.3 · Outline with keyword distributionThe planner assigns each keyword to exactly one section and each research question to exactly one section. No keyword stuffing, no section repeating what the last one said.4 · Section-by-section writingEach section is written by its own agent call, with only its own assignments, its own target word count, and its own sources. Output is restricted to a whitelist of HTML tags (h2, h3, p, ul, ol, li, strong, em, a) — nothing that will break your theme.5 · Editing + internal links from your real sitemapThe Editor fetches your site's sitemap, picks 3–6 genuinely relevant internal pages, and links them on natural anchor text inside existing paragraphs. It then writes the intro (primary keyword in the first paragraph), the conclusion, and a Resources list of every cited source.Internal links come only from your sitemap. It cannot link to a page that doesn't exist.6 · The SEO quality gateThis is the part that separates it from a prompt in a box.A grader scores the finished HTML 0–100 across five categories:Score below your threshold (default 75) → a Reviser applies the grader's specific fix list — what to change and where — in one pass. One pass, not a loop: quality improves, cost stays capped and predictable.The final score is stored on the post and written back to your queue sheet, so you can see which keywords produce weak articles.7 · Metadata that's actually valid Title 50–65 characters with the primary keyword, clean slug, 40–60 word excerpt. Category is chosen from your real WordPress categories — the agent calls your site's category endpoint and must return an ID that exists. No invented category IDs, no everything-in-Uncategorized. 8 · Tags — get-or-create, not duplicate-or-failFour long-tail, hyphenated tags (never one-word junk like "seo"). For each: search your WordPress tags → reuse the ID if it exists → create it with a description if it doesn't → collect the IDs → apply them to the post. Your tag taxonomy stays clean no matter how many posts you run.9 · Featured image (optional)Flip one dropdown to true and the workflow writes a photographic image prompt from the article, generates it with gpt-image-1 at 1536×1024, resizes to a web-friendly 1200×800, uploads it to your Media Library with alt text, and sets it as the featured image.Set it to false and that entire branch is skipped — no OpenAI key needed at all.10 · PublishThe post lands in WordPress as a draft, with content, slug, category, tags, excerpt and featured image already set. You read it, you decide, you hit publish. One field change makes it publish automatically if you want that.Requirements n8n — Cloud or self-hosted — with the LangChain/AI nodes available OpenRouter API key — runs every writing and research agent (required) WordPress site with REST API + an Application Password (required to publish) OpenAI API key — only if you want featured images (optional) Google account — only for the optional scheduled queue (optional) No coding. Import one JSON file, attach credentials, submit a form.Cost per articleRoughly 10–15 model calls: research (one live-search call), keyword strategy, outline, one call per section, editor, grader, optional reviser, metadata, image prompt, tags.Everything except the research step runs on a cheap mini model, so a full article costs a small fraction of what an equivalent hand-written brief would. The featured image is the most expensive single item — turn it off and the run is cents. Exact numbers depend on the OpenRouter model you pick, and you can swap the model on one node to trade cost for quality.Honest limitationsI'd rather you know before you buy: Keyword data is AI-derived, not Ahrefs. There's no search-volume or keyword-difficulty API here. The strategy agent uses live SERP research and its own judgement. Use it to structure articles, not to replace a keyword tool. Internal linking needs a sitemap. The Editor fetches page-sitemap.xml (the Yoast/Rank Math layout). Different SEO plugin, different filename — it's one field to change, and it's covered in the install guide. No sitemap, no internal links, and the grader will dock you 10 points. Posts publish as drafts by default. Deliberate. Fully automated publishing is one dropdown away, but AI writing an article and pushing it live unread is how sites get hurt. The grader is an LLM, not Google. A 92 means the article satisfies a strict on-page checklist — one <h1>, keywords placed, links present, readable paragraphs, right length. It's a real quality floor, not a ranking prediction. It sets the WordPress excerpt, not your SEO plugin's meta description. Many themes and plugins use the excerpt as the meta description; if yours doesn't, that field stays empty. gpt-image-1 requires a verified OpenAI organisation. If yours isn't verified, image generation returns a 403 — use the no-image path, or swap the node. One article per run. By design — quality per post, not volume. Use the queue sheet if you want one a day on a schedule. FAQDoes it work on n8n Cloud? Yes. Self-hosted works too, as long as the AI nodes and the Edit Image node are available in your build.Can I change the writing style? Yes — there's a Writing Style field on the form, and every agent's system prompt is a plain text field you can edit.Can I use a different model? Yes. Every agent hangs off two model nodes — swap the model name once and the whole workflow follows. The research node is set to perplexity/sonar because it searches live; keep that one.Does it work on a brand new site with no pages? It'll write and publish fine, but with no sitemap pages to link to, the internal-links score drops and the article may sit under the revision threshold. Best on a site with existing content.Can I run several keywords at once? Submit the form again, or enable the Google Sheets queue and add rows.What if the article scores badly? It's revised once, then published as a draft with the score attached. You'll see the score before you publish anything.Support & updatesQuestions, or a workflow that won't import — message me through Gumroad.Includes free updates to the workflow file.Not affiliated with or endorsed by WordPress, Automattic, OpenAI, OpenRouter, Perplexity, Google, or n8n.