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"
- Add Airtable node → Resource: "Record" → Operation: "Get All".
- Base ID: your base ID (from URL: airtable.com/appXXXXXX). Table: "Posts".
- Filter by Formula:
AND({Status}="Ready to Publish", OR({Scheduled Date}="", {Scheduled Date}<=NOW())). - Set "Poll Every" to 5 minutes. This checks for new ready posts without webhooks.
Step 2: Transform Markdown to Gutenberg Blocks
- Add Code node (JavaScript) after Airtable. Name it "Markdown to Blocks".
- Paste transformation script: splits Markdown headings (
##) intoblocks, paragraphs into, images intowith src/id. - Output:
return [{json: {blocks: generatedBlocks, title: $json.Title, slug: $json.Slug, categories: $json.Categories, tags: $json.Tags, featured_media: $json.FeaturedImageId}}];. - Test with a sample record — verify output matches Gutenberg block schema.
Step 3: Upload Featured Image to WordPress Media Library
- Add HTTP Request node → Method: POST → URL:
https://yoursite.com/wp-json/wp/v2/media. - Authentication: "Header Auth" → Name: "Authorization", Value:
Basic {{base64("username:app_password")}}. - Headers:
Content-Type: image/jpeg(dynamic based on file extension). - Body: Binary data from image URL (use "Get Binary File" node before this).
- Response: capture
id→ pass to next node asfeatured_media.
Step 4: Create or Update WordPress Post
- HTTP Request node → Method: POST → URL:
https://yoursite.com/wp-json/wp/v2/posts. - Same Header Auth. Headers:
Content-Type: application/json. - Body (JSON):
{"title": "{{$json.title}}", "content": "{{$json.blocks}}", "status": "publish", "slug": "{{$json.slug}}", "categories": {{$json.categories}}, "tags": {{$json.tags}}, "featured_media": {{$json.featured_media}}}. - 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
- Airtable node → Resource: "Record" → Operation: "Update".
- Record ID: from trigger node (
{{$json.id}}). - 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.
| Feature | n8n (Self-Hosted) | n8n Cloud | Zapier | Make (ex-Integromat) | Custom WP-CLI Scripts |
|---|---|---|---|---|---|
| Monthly Cost (5k executions) | $5 VPS only | €50 (Pro) | $73.50 (Professional) | $29 (Core) | $0 + dev time |
| WordPress Nodes | HTTP Request (full API) | HTTP Request (full API) | Native WP action (limited) | Native WP module (good) | Full CLI control |
| Data Privacy | Complete (your server) | EU-hosted, GDPR | US servers, shared | EU/US options | Complete |
| Custom Code Support | JS/Python nodes | JS/Python nodes | Code step (limited) | Custom functions | Unlimited (bash/PHP) |
| Learning Curve | Medium (visual + code) | Medium | Low (no-code) | Medium (scenario builder) | High (CLI + cron) |
| Gutenberg Block Control | Full (raw JSON) | Full (raw JSON) | Basic (HTML only) | Good (block mapper) | Full (WP-CLI blocks) |
| Best For | Teams needing control + scale | Teams wanting zero-ops | Non-technical marketers | Visual builders | Dev-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.
0 comments:
Post a Comment