🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

WordPress + Leonardo AI: publish posts effortlessly

Lisa Granqvist Partner Workflow Automation Expert

Writing the post is only half the work. The rest is the tedious part: tightening sections, hunting for sources, generating a decent featured image, uploading it, fixing ALT text, then finally publishing without breaking formatting.

This is where WordPress AI publishing helps. Content marketers feel it first, honestly. But consultants shipping weekly insights and small teams running a company blog end up stuck in the same loop. The outcome is simple: a publish-ready post with a clean featured image, produced with far fewer handoffs.

This workflow takes a topic, drafts a full article, generates a Leonardo AI featured image, and publishes to WordPress. You’ll see how the automation works, what you need, and where people usually get tripped up.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: WordPress + Leonardo AI: publish posts effortlessly

The Problem: Publishing Is Still Too Manual

A solid draft shouldn’t turn into a 30-step checklist, but that’s what publishing often becomes. You finish writing, then lose momentum while cleaning HTML, double-checking the structure, adding sources, and rewriting titles to fit SEO. After that comes the image scramble: you either settle for stock photos that look like everyone else, or you burn time prompting, downloading, re-uploading, and fixing ALT text. And if you publish frequently, small mistakes sneak in. A broken link here, missing category there, a thin “sources” section that makes your post feel less credible.

The friction compounds, especially when you’re trying to stay consistent.

  • Turning a topic into a structured article can take about 2 hours when you include research, formatting, and polishing.
  • Featured images often become a bottleneck, because generating one, checking it, and uploading it is repetitive but easy to mess up.
  • Quality checks are inconsistent when you’re rushing, which means short posts slip through and require rewrites later.
  • Source links and SEO details get added late, so the post looks “done” but isn’t actually ready to publish.

The Solution: Topic to Published WordPress Post (With a Featured Image)

This n8n workflow starts with a simple input (manual trigger, or something you pass in from chat, Telegram, or a webhook) and turns it into a WordPress post you can actually ship. First, it extracts and cleans the topic, even if you paste something messy like “/topic …” commands. Then it applies a style guide so your posts stay consistent: practical tone, clear sections, and clean HTML that won’t fight the WordPress editor. After that, it runs an AI research request, generates a full draft, and polishes it for readability. A word-length guard checks the output, and if it comes out thin, it automatically expands the sections that usually need substance (“why it matters,” risks, and the action plan). Finally, it creates a text-free, editorial-style featured image via Leonardo AI, uploads it to WordPress with sensible ALT text, compiles sources into clickable links, and publishes immediately.

The workflow begins when you provide a topic. AI handles research, drafting, tone revision, and minimum word count checks. Then Leonardo AI generates the featured image while n8n waits for it to finish, uploads it to WordPress, and publishes the post with sources and categories in place.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you publish three posts a week. Manually, a realistic process is about 2 hours to draft and polish, plus maybe 30 minutes to create a usable featured image, upload it, and fix ALT text, which is roughly 7 to 8 hours a week. With this workflow, you spend about 10 minutes submitting the topic and later reviewing the draft. Leonardo image generation and uploading runs in the background (there’s a built-in wait), so you’re mostly just approving the final output. Most teams get several hours back every week, and the posts ship more consistently.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • WordPress site for publishing posts and uploading media
  • Leonardo AI to generate the featured image
  • API credentials (WordPress Application Password, Leonardo API key)

Skill level: Intermediate. You’ll connect APIs, copy credentials, and test a few runs to match your blog’s style.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

Topic comes in. You trigger the workflow manually (or feed it a message from chat/Telegram/webhook), and n8n extracts the real topic from whatever you pasted.

Research and drafting happen next. The workflow assembles a research prompt, calls an AI research endpoint, then rewrites the draft to match your style guide so the sections stay predictable and easy to scan.

Quality control kicks in. A word-length gate checks for at least 1,600 words. If the draft is short, it expands the parts that usually feel thin, then merges everything into a final version.

Image + publishing finishes the job. It generates a clean image prompt, sends it to Leonardo AI, waits for completion, retrieves the image file, uploads it to WordPress, sets ALT text, and publishes the post with sources compiled into clickable links.

You can easily modify the style guide to match your brand voice, or change how categories are assigned based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Manual Trigger

Start the workflow manually so you can validate the topic extraction and AI research output before publishing.

  1. Add the Manual Execution Start node as the trigger.
  2. Connect Manual Execution Start to Derive Topic.

Step 2: Connect OpenAI for Research and Editing

This workflow uses multiple AI calls for research, tone editing, and expansion. Configure OpenAI credentials across the research and LLM nodes.

  1. In AI Research Request, set URL to https://api.openai.com/v1/chat/completions and JSON Body to ={{$json}}.
  2. Credential Required: Connect your openAiApi credentials in AI Research Request.
  3. In AI Tone Revision, set URL to https://api.openai.com/v1/chat/completions and JSON Body to ={{ $json }}.
  4. Credential Required: Connect your openAiApi credentials in AI Tone Revision.
  5. Open Expand Article Draft and confirm Model is set to gpt-4.1 with JSON Output enabled.
  6. Credential Required: Connect your openAiApi credentials in Expand Article Draft.
  7. Open Generate Image Prompt and confirm the prompt includes {{ $json.title }} and {{ $json.content }}.
  8. Credential Required: Connect your openAiApi credentials in Generate Image Prompt.
Tip: The AI prompt structure is built upstream by Compose Style Guide, Assemble Research Prompt, and Prepare Tone Edit. If outputs look off, validate those code nodes before adjusting AI settings.

Step 3: Configure Research and Tone Processing Nodes

These code nodes build the style guide, construct prompts, and guard word length before content is prepared for image generation and publishing.

  1. In Compose Style Guide, keep the default style rules and clean HTML constraints as provided.
  2. In Assemble Research Prompt, verify the model is gpt-4o-mini and that it returns a JSON object with "title" and "content".
  3. In Prepare Tone Edit, confirm it builds a JSON edit request with model: "gpt-4o-mini" and temperature: 0.4.
  4. In Word Length Gate, verify the minimum word count logic uses const MIN = 1600.
  5. In Branch Condition, ensure the boolean condition checks =={{ $json.need_expand }} equals true.
  6. Confirm the flow is Manual Execution StartDerive TopicCompose Style GuideAssemble Research PromptAI Research RequestPrepare Tone EditAI Tone RevisionWord Length GateBranch Condition.
⚠️ Common Pitfall: If the model returns non-JSON content, Parse Title Content Image will throw a parsing error. Ensure the AI responses are constrained to JSON as defined in Assemble Research Prompt and Prepare Tone Edit.

Step 4: Configure Image Generation and Retrieval

This stage generates a featured image using Leonardo, waits for completion, and retrieves the generated file.

  1. In Leonardo Image Create, set URL to https://cloud.leonardo.ai/api/rest/v1/generations and keep the JSON body with "prompt": "{{ $json.message.content }}".
  2. Credential Required: Connect your httpBearerAuth credentials in Leonardo Image Create.
  3. In Capture Generation ID, keep the ID extraction logic to output generationId.
  4. In Pause Execution, set Amount to 30 seconds to allow the image to render.
  5. In Fetch Image Status, set URL to =https://cloud.leonardo.ai/api/rest/v1/generations/{{ $json.generationId }}.
  6. Credential Required: Connect your httpBearerAuth credentials in Fetch Image Status.
  7. In Retrieve Image File, set URL to ={{ $json.generations_by_pk.generated_images[0].url }}.
Tip: If image generation times vary, increase the Pause Execution Amount beyond 30 seconds or implement a polling loop.

Step 5: Configure WordPress Media and Publishing

Upload the generated image, set its alt text, and publish the final post in WordPress.

  1. In Upload Image to WordPress, set URL to https://public-api.wordpress.com/wp/v2/sites/[YOUR_ID]/media and Content Type to binaryData.
  2. Credential Required: Connect your oAuth2Api credentials in Upload Image to WordPress. (Optional secondary: httpBasicAuth if your WordPress setup requires it.)
  3. In Set Image Alt Text, set URL to =https://public-api.wordpress.com/wp/v2/sites/[YOUR_ID]/media/{{ $json.id }} and alt_text to ={{ $('Generate Image Prompt').item.json.message.content }}.
  4. Credential Required: Connect your oAuth2Api credentials in Set Image Alt Text. (Optional secondary: httpBasicAuth.)
  5. In Publish WordPress Post, set URL to https://public-api.wordpress.com/wp/v2/sites/[YOUR_ID]/posts.
  6. Set JSON Body to {{ { "title": $("Parse Title Content Image").item.json.title, "content": $("Parse Title Content Image").item.json.content, "status": "publish", "categories": ["[YOUR_ID]"], "featured_media": $("Upload Image to WordPress").item.json.id } }}.
  7. Credential Required: Connect your oAuth2Api credentials in Publish WordPress Post. (Optional secondary: httpBasicAuth.)
⚠️ Common Pitfall: Replace [YOUR_ID] in all WordPress URLs and the categories array or the post will fail to publish.

Step 6: Test and Activate Your Workflow

Validate the full end-to-end pipeline before turning it on for production use.

  1. Click Execute Workflow to run from Manual Execution Start and observe outputs through Publish WordPress Post.
  2. Confirm that Parse Title Content Image returns a valid title, content, and image_filename.
  3. Verify Upload Image to WordPress returns a media id and Publish WordPress Post creates a published post.
  4. Once validated, toggle the workflow to Active for production use.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • WordPress credentials can expire or lack the right permissions. If things break, check your Application Password and user role capabilities 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.

Frequently Asked Questions

How long does it take to set up this WordPress AI publishing automation?

About 30 minutes if your WordPress and Leonardo credentials are ready.

Do I need coding skills to automate WordPress AI publishing?

No. You’ll mostly paste API keys and adjust a few text settings. The hardest part is deciding what “good enough to publish” means for your brand.

Is n8n free to use for this WordPress AI publishing workflow?

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 Leonardo AI usage and whatever AI research/drafting endpoint you connect for the HTTP requests.

Where can I host n8n to run this automation?

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.

Can I customize this WordPress AI publishing workflow for scheduled publishing instead of immediate publishing?

Yes, but you’ll change the final WordPress publish call to create a draft or future-dated post instead. The simplest approach is adjusting the “Publish WordPress Post” request so it sets status to draft (or schedules a publish date). Common customizations include swapping the style guide, changing category rules, and tightening the minimum word count gate so shorter posts get expanded automatically.

Why is my WordPress connection failing in this workflow?

Most of the time it’s an Application Password issue, either revoked or tied to a user that can’t upload media. Update the credentials in n8n and confirm the account can create posts and upload images. If publishing works but image upload fails, check the WordPress site’s security plugins and file upload limits because they can block REST requests. Also look for rate limiting on hosts that aggressively throttle repeated requests.

How many posts can this WordPress AI publishing automation handle?

A lot, as long as your n8n plan and your AI/image providers can keep up. On n8n Cloud, your limit is mainly monthly executions, so higher volume means a bigger plan. If you self-host, there’s no execution cap, but your server resources become the limit. In practice, this workflow is “batchable,” but Leonardo image generation time and the Wait step mean you’ll want to stagger runs if you’re publishing dozens in a day.

Is this WordPress AI publishing automation better than using Zapier or Make?

For this kind of workflow, n8n is usually a better fit because you can do branching, gates (like word count checks), and multi-step waits without the automation turning into a fragile chain of mini-zaps. Self-hosting is also a big deal if you publish often and don’t want every run priced per task. Zapier or Make can be fine for lighter two-step flows, like “new row → create draft.” If you’re unsure, map the full process you want first (drafting, revisions, image generation, upload, publish). Then pick the tool that can handle the whole thing without workarounds. Talk to an automation expert if you want a quick recommendation.

Once this is running, publishing stops feeling like a chore you have to psych yourself up for. The workflow handles the repetitive parts so you can focus on the final review and the ideas that actually move your business.

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.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal