Saturday, August 8, 2026

Step-by-Step Guide to Automate WordPress Publishing with n8n

Over 43% of all websites run on WordPress, yet most content teams still manually copy-paste articles from Google Docs into the block editor. That workflow wastes 5–10 hours weekly per publisher and introduces formatting errors that hurt SEO. n8n, the source-available automation platform founded in 2019 by Jan Oberhauser in Berlin, connects 350+ apps through a visual node editor — no code required. This guide shows exactly how to build a production-ready pipeline that pulls content from Airtable, formats it for Gutenberg blocks, and publishes to WordPress on schedule, cutting publishing time by 90%.

Quick Answer: Connect n8n to WordPress via the REST API using Application Passwords authentication. Build a workflow: trigger on Airtable "Ready to Publish" status → fetch content → transform to Gutenberg blocks via HTTP Request nodes → POST to /wp/v2/posts endpoint → update Airtable with published URL and date. Self-host n8n on a VPS for $5/mo or use n8n Cloud at €20/mo. Test with one post, then scale to 50+ weekly.

Why Automate WordPress Publishing with n8n

Eliminate Manual Bottlenecks

Manual publishing forces editors to log in, create a post, paste content, fix formatting, add categories, set featured images, configure SEO meta, and hit publish — repeated for every article. A 2023 Content Marketing Institute survey found teams spend 37% of production time on administrative tasks. n8n reduces this to a single status change in Airtable or Notion.

Source-Available Flexibility Over Zapier

Unlike Zapier's closed ecosystem, n8n's source-available model lets you self-host on any VPS (DigitalOcean, Hetzner, AWS) for full data control. The platform supports 400+ native integrations and custom JavaScript/Python nodes for edge cases like parsing custom Gutenberg block markup or handling WordPress multisite networks.

Real-World Example: SaaS Blog Scaling to 50 Posts/Week

A B2B SaaS company migrated from manual publishing to n8n in April 2024. Their content team of three writers and one editor now manages 50+ posts weekly. The workflow pulls from Airtable, converts Markdown to Gutenberg blocks via a custom Code node, uploads featured images to WordPress media library, injects Yoast SEO fields, and schedules publication. Publishing time dropped from 45 minutes to 3 minutes per post.

Prerequisites: What You Need Before Starting

WordPress REST API Access

WordPress 4.7+ includes the REST API by default. Enable pretty permalinks (Settings → Permalinks → Post name). Create an Application Password: Users → Profile → Application Passwords → "New Application Password" → name it "n8n-automation" → copy the 24-character password. This replaces basic auth and works with two-factor authentication.

n8n Instance: Self-Hosted or Cloud

Self-host via Docker on a $5/mo VPS (1 GB RAM, 1 vCPU) using the official n8n Docker image. Run: docker run -d --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n. For zero-maintenance, n8n Cloud starts at €20/mo for 2,500 executions. Both support the same nodes and credentials.

Content Source: Airtable, Notion, or Google Sheets

Structure your content database with fields: Title (single line), Slug (formula), Content (long text, Markdown), Status (single select: Draft, Ready, Published), Featured Image URL (URL), Categories (multi-select), Tags (multi-select), Scheduled Date (date/time), Published URL (URL, auto-filled). Example base: airtable.com/shrXyz123.

Build the Core Workflow: Step-by-Step

Step 1: Create Trigger Node — Airtable "Ready to Publish"

  1. Add Airtable node → Resource: "Record" → Operation: "Get All".
  2. Base ID: your base ID (from URL: airtable.com/appXXXXXX). Table: "Posts".
  3. Filter by Formula: AND({Status}="Ready to Publish", OR({Scheduled Date}="", {Scheduled Date}<=NOW())).
  4. Set "Poll Every" to 5 minutes. This checks for new ready posts without webhooks.

Step 2: Transform Markdown to Gutenberg Blocks

  1. Add Code node (JavaScript) after Airtable. Name it "Markdown to Blocks".
  2. Paste transformation script: splits Markdown headings (##) into blocks, paragraphs into , images into with src/id.
  3. Output: return [{json: {blocks: generatedBlocks, title: $json.Title, slug: $json.Slug, categories: $json.Categories, tags: $json.Tags, featured_media: $json.FeaturedImageId}}];.
  4. Test with a sample record — verify output matches Gutenberg block schema.

Step 3: Upload Featured Image to WordPress Media Library

  1. Add HTTP Request node → Method: POST → URL: https://yoursite.com/wp-json/wp/v2/media.
  2. Authentication: "Header Auth" → Name: "Authorization", Value: Basic {{base64("username:app_password")}}.
  3. Headers: Content-Type: image/jpeg (dynamic based on file extension).
  4. Body: Binary data from image URL (use "Get Binary File" node before this).
  5. Response: capture id → pass to next node as featured_media.

Step 4: Create or Update WordPress Post

  1. HTTP Request node → Method: POST → URL: https://yoursite.com/wp-json/wp/v2/posts.
  2. Same Header Auth. Headers: Content-Type: application/json.
  3. Body (JSON): {"title": "{{$json.title}}", "content": "{{$json.blocks}}", "status": "publish", "slug": "{{$json.slug}}", "categories": {{$json.categories}}, "tags": {{$json.tags}}, "featured_media": {{$json.featured_media}}}.
  4. For updates: change Method to POST with ?id={{$json.wp_id}} or use PUT to /wp/v2/posts/{{$json.wp_id}}.

Step 5: Sync Back to Airtable

  1. Airtable node → Resource: "Record" → Operation: "Update".
  2. Record ID: from trigger node ({{$json.id}}).
  3. Fields: Status → "Published", Published URL → https://yoursite.com/{{$json.slug}}, Published Date → {{new Date().toISOString()}}, WP Post ID → {{$json.id}} (from WordPress response).

Advanced Patterns: Scheduling, SEO, and Multisite

Scheduled Publishing with Cron Node

Replace Airtable poll trigger with Cron node: "Every day at 9:00 AM" → Airtable "Get All" with formula AND({Status}="Scheduled", {Scheduled Date}<=NOW()). This publishes future-dated posts automatically. Add a "Wait" node before publishing if you need exact minute precision (n8n's cron runs at minute granularity).

Inject Yoast/Rank Math SEO Fields

Extend the post creation JSON body: "meta": {"_yoast_wpseo_title": "{{$json.seo_title}}", "_yoast_wpseo_metadesc": "{{$json.seo_description}}", "_yoast_wpseo_focuskw": "{{$json.focus_keyword}}"}. Map these from Airtable SEO fields. Rank Math uses rank_math_title, rank_math_description — check plugin documentation for exact meta keys.

WordPress Multisite Support

For multisite, the REST API base becomes https://network.com/subsite/wp-json/wp/v2/. Store subsite path in Airtable. Use an "IF" node to route to correct endpoint. Authentication works network-wide if the user has permissions on each subsite. Test with one subsite first.

Comparison: n8n vs Zapier vs Make vs Custom WP-CLI

Choosing the right automation tool depends on volume, technical capacity, and data sovereignty needs. The table below compares four approaches for WordPress publishing automation.

All prices reflect 2025 published rates; execution limits apply to cloud tiers.

Featuren8n (Self-Hosted)n8n CloudZapierMake (ex-Integromat)Custom WP-CLI Scripts
Monthly Cost (5k executions)$5 VPS only€50 (Pro)$73.50 (Professional)$29 (Core)$0 + dev time
WordPress NodesHTTP Request (full API)HTTP Request (full API)Native WP action (limited)Native WP module (good)Full CLI control
Data PrivacyComplete (your server)EU-hosted, GDPRUS servers, sharedEU/US optionsComplete
Custom Code SupportJS/Python nodesJS/Python nodesCode step (limited)Custom functionsUnlimited (bash/PHP)
Learning CurveMedium (visual + code)MediumLow (no-code)Medium (scenario builder)High (CLI + cron)
Gutenberg Block ControlFull (raw JSON)Full (raw JSON)Basic (HTML only)Good (block mapper)Full (WP-CLI blocks)
Best ForTeams needing control + scaleTeams wanting zero-opsNon-technical marketersVisual buildersDev-heavy orgs

Common Mistakes and How to Fix Them

Mistake 1: Using Basic Auth Instead of Application Passwords

Why It Hurts: Basic auth fails with 2FA, exposes main password, and gets blocked by security plugins like Wordfence. Fix: Always generate Application Passwords per integration (Users → Profile → Application Passwords). Rotate quarterly.

Mistake 2: Skipping Gutenberg Block Validation

Why It Hurts: Malformed block comments () break the block editor, causing "This block contains unexpected content" errors. Fix: Validate generated blocks against WordPress Block API spec using a JSON schema validator in a Code node before POST.

Mistake 3: Not Handling Rate Limits

Why It Hurts: WordPress REST API allows 100 requests/minute per IP by default. Bulk publishing 50 posts triggers 429 errors. Fix: Add "Throttle" node (1 request/second) or increase limit via rest_api_default_filters filter in functions.php: return 300;.

Mistake 4: Hardcoding Category/Tag IDs

Why It Hurts: IDs change across environments (dev/staging/prod). Workflow breaks on deploy. Fix: Use "Search" nodes: GET /wp/v2/categories?search={{$json.category_name}} → map returned ID dynamically.

Pro Tips

  • Store credentials in n8n's encrypted credential store — never in workflow JSON.
  • Use "Error Trigger" workflow to alert Slack/email on failures with full execution context.
  • Version-control workflows: export JSON → commit to Git → CI/CD deploy to n8n via API.
  • Pre-generate slugs in Airtable formula: LOWER(SUBSTITUTE({Title}, " ", "-")) to avoid WP slug conflicts.
  • Batch featured image uploads: run a separate nightly workflow to sync all images first, then reference media IDs in main workflow.

FAQ

What is n8n and how does it differ from Zapier?

n8n is a source-available workflow automation platform founded in 2019 that runs on Node.js. Unlike Zapier's closed SaaS model, n8n can be self-hosted on your infrastructure, supports custom JavaScript/Python nodes, and charges per execution rather than per task. It connects 350+ apps via REST APIs and offers a visual node editor for building complex logic.

Can n8n publish to WordPress without coding?

Yes. The HTTP Request node handles all WordPress REST API endpoints through a no-code interface. You configure authentication, headers, and JSON body visually. For Markdown-to-Gutenberg conversion, a pre-built Code node template (available in n8n's community library) eliminates custom scripting for most use cases.

How do I authenticate n8n with WordPress securely?

Create a WordPress Application Password (Users → Profile → Application Passwords). In n8n, use Header Auth: Authorization: Basic base64(username:app_password). This works with 2FA enabled, can be revoked instantly, and scopes access to REST API only — not full admin login.

Why do my Gutenberg blocks show validation errors after n8n publishing?

WordPress expects specific block comment syntax: . Common issues: missing closing comments, incorrect attribute quoting, or unsupported block types. Validate output against the Block API schema and test in the block editor's "Code Editor" mode before scaling.

What's the roadmap for n8n WordPress integration in 2025?

n8n's 2025 roadmap includes a native WordPress node (tracking issue #4821) with built-in Gutenberg block mapper, media library browser, and taxonomy search. The community has published 12 WordPress-specific templates in Q1 2025. Self-hosted users can already test beta nodes via the "Community Nodes" feature introduced in v1.30.

Conclusion

Automating WordPress publishing with n8n transforms content operations from a manual bottleneck into a scalable pipeline. The five-step workflow — trigger, transform, upload media, create post, sync back — deploys in under two hours and handles 50+ weekly posts on a $5 VPS. Key advantages over Zapier: full Gutenberg block control, data sovereignty, zero per-task fees, and extensibility via JavaScript/Python. Start with one content source (Airtable), validate block output in staging, then expand to scheduled publishing, SEO meta injection, and multisite support. Your editorial team will reclaim 15+ hours weekly for actual content strategy.

  • Use Application Passwords — never basic auth — for secure WordPress REST API access.
  • Validate Gutenberg block JSON against WordPress Block API schema before publishing.
  • Throttle requests to 1/second to avoid 429 rate-limit errors on bulk runs.
  • Version-control workflows in Git for auditability and CI/CD deployment.

Sources

Share:

0 comments:

Post a Comment