WordPress + OpenAI: SEO drafts ready to review
Writing “just one blog post” has a way of turning into a whole afternoon. Topic research, outlines, draft writing, finding a decent featured image, formatting for WordPress, then realizing you forgot the meta basics and starting over.
This WordPress AI drafts automation hits marketing managers first, honestly. But agency owners pushing content for multiple clients and solo founders trying to stay consistent feel it too. The outcome is simple: you submit keywords, and a review-ready WordPress draft (with a featured image) shows up for you to tweak and publish.
Below you’ll see how the workflow runs, what it automates end-to-end, and what you can customize so the output sounds like your brand instead of “generic AI blog.”
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: WordPress + OpenAI: SEO drafts ready to review
flowchart LR
subgraph sg0["Intake Form Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Intake Form Trigger"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Assign WP Settings", pos: "b", h: 48 }
n2@{ icon: "mdi:robot", form: "rounded", label: "Generate Article Outline", pos: "b", h: 48 }
n3@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Validate AI Payload", pos: "b", h: 48 }
n4@{ icon: "mdi:swap-vertical", form: "rounded", label: "Expand Chapter List", pos: "b", h: 48 }
n5@{ icon: "mdi:robot", form: "rounded", label: "Compose Chapter Text", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Combine Chapter Data"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Assemble Article HTML"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/wordpress.svg' width='40' height='40' /></div><br/>Publish Draft to WP"]
n9@{ icon: "mdi:robot", form: "rounded", label: "Generate Cover Image", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Upload Media Asset"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Attach Featured Media"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Return Success Response"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Return Error Response"]
n14@{ icon: "mdi:wrench", form: "rounded", label: "Wikipedia Lookup Tool", pos: "b", h: 48 }
n0 --> n1
n1 --> n2
n14 -.-> n2
n10 --> n11
n8 --> n9
n7 --> n8
n4 --> n6
n4 --> n5
n5 --> n6
n3 --> n4
n3 --> n13
n9 --> n10
n11 --> n12
n6 --> n7
n2 --> n3
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n2,n5,n9 ai
class n14 ai
class n3 decision
class n10,n11,n12,n13 api
class n7 code
classDef customIcon fill:none,stroke:none
class n0,n6,n7,n8,n10,n11,n12,n13 customIcon
Why This Matters: Publishing SEO content without the busywork
Most content teams don’t struggle with ideas. They struggle with throughput. You start with a keyword list, then you bounce between tabs for research, try to force an outline into shape, write sections that don’t quite flow, and then lose another chunk of time formatting headings and lists so WordPress doesn’t look like a wall of text. The featured image is its own mini-project, and it’s easy to end up with something off-brand or painfully stock-photo. Multiply that by a weekly cadence (or several clients) and the mental load becomes the real blocker.
The friction compounds. Here’s where it breaks down in real life.
- Keyword research lives in one place, drafts live in another, and you waste time copying and reformatting the same info.
- Outlines are inconsistent, so writers (or you) end up rewriting structure before the writing even starts.
- Factual details get hand-waved, which means more editing, more second-guessing, and occasional embarrassing corrections.
- Images become a last-minute scramble, so posts ship late or ship with “good enough” visuals.
What You’ll Build: Keyword-to-draft WordPress publishing with AI
This workflow turns a small input (a few keywords and basic settings) into a complete WordPress draft that’s ready for review. It starts with an intake form, then uses OpenAI to generate a sensible SEO-friendly structure: a title, subtitle, and a chapter plan that actually flows. Next, it writes each chapter with awareness of what came before and what comes after, so the piece reads like one article, not stitched-together sections. While the text is being created, the workflow also pulls factual context via a Wikipedia lookup step to ground the content in real references. Finally, it assembles everything into clean HTML formatting, creates a custom featured image with DALL·E, uploads that image to WordPress, and attaches it to the draft post automatically.
The workflow begins when you submit keywords through the n8n form. From there, OpenAI plans the post, writes chapters, and the workflow merges everything into a single formatted article. WordPress receives a draft plus an uploaded featured image, so you can edit quickly and publish when it’s ready.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you publish 3 posts a week. Manually, a “decent first draft” often takes about 2 hours to research, outline, write, format, and hunt down an image, so you’re looking at roughly 6 hours weekly before edits even start. With this workflow, you spend about 5 minutes submitting keywords, then wait a few minutes while it generates the draft and featured image. You get most of that writing time back and can put it into real editing, internal links, and product CTAs.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- WordPress site for creating draft posts via REST API
- OpenAI to generate outlines, chapters, and images
- WordPress Application Password (get it from WordPress Admin → Users → Profile)
Skill level: Beginner. You’ll connect accounts, paste an API key, and confirm your WordPress REST API works.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A form submission triggers everything. You enter comma-separated keywords, choose how many chapters you want, and set a max word count. Submitting the form starts the workflow immediately.
The workflow sets your WordPress “defaults.” n8n loads your site URL and key settings (so you’re not retyping them each time), then prepares the prompt for the AI outline step.
OpenAI plans and writes the article in sections. First it creates the title and structure, then n8n validates the payload so you don’t end up publishing a broken draft. After that, the workflow expands the chapter list and generates each chapter’s text with context, pulling extra factual grounding using a Wikipedia lookup tool when needed.
WordPress receives a draft plus a featured image. n8n merges chapters, assembles formatted HTML, publishes the post as a draft, generates a DALL·E image, uploads it to your media library, and attaches it as the featured image. If anything fails, the workflow returns a clear success or error response.
You can easily modify the chapter structure to match your editorial template based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
This workflow starts when a user submits a form. Configure the form fields and response handling in Intake Form Trigger.
- Add the Intake Form Trigger node and set Path to
create-wordpress-post. - Set Form Title to
Create a WordPress post with AIand Form Description toFill this form with the required information to create a draft post on WordPress. - Configure the form fields: Keywords (comma-separated), Number of chapters (dropdown with options
1–10), and Max words count. - Set Response Mode to
responseNodeso the workflow can return success or error messages.
Step 2: Connect WordPress Settings
Map form inputs to internal settings and define the WordPress base URL in Assign WP Settings.
- Add Assign WP Settings and create assignments for wordpress_url, keywords, chapters, and words.
- Set wordpress_url to
https://you-wordpress-url-here.com/. - Map keywords to
{{ $json['Keywords (comma-separated)'] }}, chapters to{{ $json['Number of chapters'] }}, and words to{{ $json['Max words count'] }}.
Step 3: Generate and Validate the AI Outline
Create the article outline and validate the AI payload before generating chapter content.
- Add Generate Article Outline and set the model to
gpt-4-1106-previewwith JSON Output enabled. - Use the existing prompt content in Generate Article Outline to produce the JSON structure for title, subtitle, introduction, chapters, conclusions, and image prompt.
- Credential Required: Connect your openAiApi credentials for Generate Article Outline.
- Note that Wikipedia Lookup Tool is used by Generate Article Outline; add credentials to the parent node if needed. Do not add credentials on the tool node itself.
- Add Validate AI Payload and keep the conditions checking
{{$json.message.content.title}},{{$json.message.content.chapters}},{{$json.message.content.subtitle}},{{$json.message.content.introduction}},{{$json.message.content.conclusions}}, and{{$json.message.content.imagePrompt}}.
⚠️ Common Pitfall: If any of the validation fields are empty, the workflow will route to Return Error Response and stop. Ensure the AI prompt and JSON output are correct.
Step 4: Expand Chapters and Compose Text in Parallel
Split chapters into items and generate chapter text in parallel with data preparation.
- Add Expand Chapter List and set Field to Split Out to
message.content.chapters. - Expand Chapter List outputs to both Combine Chapter Data and Compose Chapter Text in parallel.
- Add Compose Chapter Text and keep the prompt content referencing
{{ $('Generate Article Outline').item.json.message.content.title }},{{ $('Assign WP Settings').item.json["keywords"] }}, and the chapter-specific fields. - Credential Required: Connect your openAiApi credentials for Compose Chapter Text.
- Add Combine Chapter Data with Mode set to
combineand Combination Mode tomergeByPositionto merge chapter titles with generated text.
Step 5: Assemble HTML and Publish the Draft
Assemble article HTML, publish the WordPress draft, then generate and upload the cover image.
- Add Assemble Article HTML and keep the JavaScript that concatenates introduction, chapter titles, chapter text, and conclusions.
- Configure Publish Draft to WP with Title set to
{{ $('Generate Article Outline').all()[0].json.message.content.title }}and Status set todraft, with Content set to{{ $json.article }}. - Credential Required: Connect your wordpressApi credentials for Publish Draft to WP.
- Configure Generate Cover Image with Resource set to
imageand Prompt set toGenerate a photographic image to be used as the cover image for the article titled: {{ $('Generate Article Outline').all()[0].json.message.content.title }}. This is the prompt for the image: {{ $('Generate Article Outline').all()[0].json.message.content.imagePrompt }}, photography, realistic, sigma 85mm f/1.4. - Credential Required: Connect your openAiApi credentials for Generate Cover Image.
- Configure Upload Media Asset with URL
https://wp-demo.mondo.surf/wp-json/wp/v2/media, MethodPOST, and Content TypebinaryData. Keep the headerContent-Dispositionasattachment; filename="example.jpg". - Credential Required: Connect your wordpressApi credentials for Upload Media Asset.
- Configure Attach Featured Media with URL
https://wp-demo.mondo.surf/wp-json/wp/v2/posts/{{ $('Publish Draft to WP').item.json.id }}and query parameter featured_media set to{{ $json.id }}. - Credential Required: Connect your wordpressApi credentials for Attach Featured Media.
⚠️ Common Pitfall: Ensure the WordPress site URL and API authentication match the domain used in Upload Media Asset and Attach Featured Media to avoid 401 errors.
Step 6: Add Error Handling and Success Responses
Return user-friendly responses for both success and failure paths.
- Connect the failure output of Validate AI Payload to Return Error Response.
- Keep Return Error Response Respond With set to
jsonand Response Body set to{ 'formSubmittedText': 'There was a problem creating the article, please refresh the form and try again!' }. - Connect Attach Featured Media to Return Success Response with Response Body set to
{ "formSubmittedText": "The article {{ $json.title.rendered }} was correctly created as a draft on WordPress!" }.
Step 7: Test & Activate Your Workflow
Run a full test to validate AI output, WordPress draft creation, and media attachment before turning the workflow on.
- Click Execute Workflow and submit the Intake Form Trigger with sample keywords, chapters, and max word count.
- Confirm Validate AI Payload routes to the success path, and that Publish Draft to WP creates a draft post with HTML content.
- Verify Upload Media Asset and Attach Featured Media complete, and the WordPress draft has a featured image.
- Check the final response from Return Success Response includes the rendered title.
- Toggle the workflow to Active to accept live form submissions.
Troubleshooting Tips
- WordPress credentials can expire or have limited permissions. If things break, check your Application Password in WordPress Admin → Users → Profile first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Quick Answers
About 30 minutes if your WordPress credentials and OpenAI key are ready.
No coding required. You’ll mostly connect WordPress and OpenAI credentials, then adjust a few prompts and settings.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs for GPT-4 and DALL·E (most teams spend a few dollars to test, then scale based on volume).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. You can adjust the “Generate Article Outline” and “Compose Chapter Text” nodes to enforce your house style (tone, reading level, CTA placement), and tweak “Assemble Article HTML” to match your preferred heading rules. Common customizations include adding a FAQ section, inserting internal-link suggestions, and generating WordPress tags/categories automatically.
Usually it’s an authentication issue: the Application Password is wrong, revoked, or tied to a user without permission to create posts. Also confirm your REST API endpoint is reachable (try loading /wp-json/wp/v2/ in a browser) and that security plugins aren’t blocking requests. If failures happen only during upload/attach steps, check that your WordPress user can upload media and that your hosting isn’t rejecting larger requests.
It scales well for small teams: dozens of drafts per week is realistic if your OpenAI rate limits allow it.
Often, yes. This workflow benefits from n8n’s ability to validate AI output, loop through chapters, merge results, and handle multi-step publishing without turning into a mess of separate zaps/scenarios. Self-hosting also matters if you plan to generate lots of drafts, since execution costs can stay predictable. Zapier or Make can still be fine for very simple “keyword in, draft out” prototypes, but they get awkward once you add chapter loops and media handling. If you want a second opinion before you commit, Talk to an automation expert.
Once this is running, your “blank page” problem turns into a quick review loop. The workflow handles the repeatable parts, and you keep the final say before anything goes live.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.