n8n and WordPress connected via HTTP Request node and REST API automation

When I started building my automated blogging system on n8n, I did what every beginner does — I grabbed the official WordPress node and assumed it would just work. It didn’t. For a real n8n WordPress integration, the built-in node kept breaking mid-workflow, sometimes connecting, sometimes not. I was already a developer working with WordPress daily, but this specific integration gave me more headaches than expected. After hours of research and failed attempts, I found the method that actually works: the HTTP Request node paired directly with the WordPress REST API — full control over publishing, image uploads, Rank Math SEO fields, and Google Sheets logging, all automated.

⚡ Key Takeaways
  • The official n8n WordPress node breaks unpredictably and can’t upload images or edit SEO meta fields
  • The HTTP Request node + WordPress REST API gives 100% control over every field, including Rank Math data
  • WordPress Application Passwords are the secure way to authenticate — never use your login password
  • Featured image uploads need a two-step process: upload to media library, then attach the returned ID

Why Not the Built-In WordPress Node

The official n8n WordPress node works for simple, read-only tasks — but it falls apart the moment your workflow needs real control.

Let me be honest about something most tutorials skip. n8n’s official WordPress node looks clean and sets up fast, and for basic tasks it’s fine. But three problems made it unusable for a production blogging workflow.

  1. It breaks unpredictably: mid-workflow, the node loses connection with no clear error message — a known issue in the n8n community.
  2. Limited field control: it handles title, content, and status fine, but Rank Math SEO fields (focus keyword, meta description, SEO title) live in post meta, and the node doesn’t expose them.
  3. No image upload support: it cannot push images to the Media Library, which is a dealbreaker when every post needs a featured image.
✅ Pro Tip: I still use the official WordPress node for one job — reading/fetching existing posts for internal linking. For read-only work it’s fine. For writing data, use the HTTP Request node every time.

What You Need Before Starting

You need a self-hosted WordPress site with admin access — this method will not work on WordPress.com’s free or personal plans.

Tools required: n8n (cloud or self-hosted both work), a self-hosted WordPress.org site with admin panel access, and WordPress version 5.6 or higher, since Application Passwords are built in from that version onward.

Step 1: Generate Your WordPress Application Password

Application Passwords let external tools like n8n connect to your site securely, without ever touching your main admin login.

  1. Log into your WordPress dashboard.
  2. Go to Users → Your Profile.
  3. Scroll down to the Application Passwords section.
  4. In the “New Application Password Name” field, type n8n Automation, then click Add New Application Password.
  5. WordPress shows a password like xxxx xxxx xxxx xxxx xxxx xxxx — copy it immediately, it’s shown only once.
⚠️ Common Mistake: The password includes spaces — that’s normal. Copy the entire string, spaces included. n8n handles it correctly as-is.

Your working credentials after this step: your WordPress URL, your admin username, and the Application Password you just generated — never your normal login password.

Official Node vs. HTTP Request Node: Which to Use

Use the official node only for simple reads; use the HTTP Request node for anything you’re writing to WordPress.

Feature Official Node HTTP Request Node
Setup time 5 minutes 15–20 minutes
Reliability Breaks unpredictably Stable in production
Image uploads Not supported Full support
Rank Math / custom meta Not accessible Fully controllable

Step 2: Connect n8n to WordPress via HTTP Request Node

Basic Auth with your Application Password is all you need to authenticate the HTTP Request node against your WordPress REST API.

In your n8n workflow, add an HTTP Request node. Before configuring the request itself, set up authentication: open the “Authentication” field and select “Basic Auth” — not Header Auth or anything else. Click “Create New” for credentials, enter your WordPress admin username and the Application Password (spaces included), and save it as something like “WordPress REST API”.

Test the connection first with a simple GET request to https://your-site.com/wp-json/wp/v2/posts?per_page=1, method GET, using your saved credential. Execute the node — you should see your post data returned as JSON.

{
  "title": "Your Post Title Here",
  "content": "Your post HTML content goes here",
  "status": "draft",
  "categories": [1],
  "tags": []
}

💡 Always set “status” to “draft” first and confirm the post lands correctly before switching any workflow to publish live.

To create a post, change the node to a POST request against https://your-site.com/wp-json/wp/v2/posts with JSON body content type, using the payload above. After execution, check WordPress → Posts → Drafts — your post should be sitting there.

Step 3: Inject Rank Math SEO Fields

Rank Math stores its SEO data in WordPress post meta, and the REST API lets you set that meta directly in the same request that creates the post.

{
  "title": "Your Post Title",
  "content": "Your post HTML content",
  "status": "draft",
  "meta": {
    "rank_math_focus_keyword": "your focus keyword here",
    "rank_math_description": "Your custom meta description — 155 chars",
    "rank_math_title": "Your SEO Title for Google — 60 chars"
  }
}

💡 This is exactly what the official WordPress node cannot do — anything stored in post meta becomes settable once you’re talking directly to the REST API.

Result: every automated post ships with a complete Rank Math setup — focus keyword, meta description, and SEO title — without ever opening the WordPress editor.

Step 4: Upload Images to the Media Library

Featured images need a two-step flow: upload the file first, then attach the returned media ID to your post.

  1. Upload the image: POST to https://your-site.com/wp-json/wp/v2/media with header Content-Disposition: attachment; filename="image-name.jpg", Content-Type: image/jpeg, and the binary image data as the body. This returns a media ID.
  2. Attach it to the post: include that ID as "featured_media" when creating or updating the post.
{
  "title": "Post Title",
  "content": "Content here",
  "featured_media": 1234
}

💡 Once attached, the featured image is set automatically — no manual step in the WordPress editor needed.

Step 5: Log Everything in Google Sheets

A Google Sheets node after publishing gives you a complete record of every post the automation has created.

Log the post ID, title, published URL, publish date, focus keyword, and Rank Math score (checked manually). This same sheet becomes useful for internal linking — when generating a new post, n8n can fetch existing titles and URLs to suggest related links automatically.

Common Errors and How to Fix Them

These are real errors I hit myself — not copied from documentation.

❌ Error: 401 Unauthorized

✅ Fix: Two causes. First, using your main login password instead of the Application Password — generate a fresh one under Users → Profile → Application Passwords and use that. Second, Application Passwords may be disabled on your host — this needs enabling in wp-config.php.

❌ Error: 403 Forbidden

✅ Fix: Your user role likely lacks publishing permission. Make sure the WordPress user has the Administrator role, not Editor or Contributor.

❌ Error: REST API returns HTML instead of JSON

✅ Fix: A security plugin (Wordfence, iThemes Security) is likely blocking the REST API. Visit your-site.com/wp-json/ directly — if you see an error page instead of JSON, whitelist the REST API in your security plugin settings.

❌ Error: Rank Math meta fields not saving

✅ Fix: Rank Math’s REST API support needs to be enabled manually — go to Rank Math → General Settings → REST API → Enable, then retry.

❌ The official WordPress node shows “Could not connect”

✅ Fix: This is exactly why the HTTP Request node exists as the reliable alternative — switch any write operation over to it for production stability.

Frequently Asked Questions

❓ Does this method work with WordPress.com?

No. This works only with self-hosted WordPress.org installations where you have admin panel access. Free or personal WordPress.com plans don’t expose the required Application Passwords feature.

❓ Is the HTTP Request method better than the official WordPress node?

For any writing operation — yes. It’s more reliable, supports image uploads, and gives full control over custom meta fields like Rank Math. The official node is still fine for simple read-only tasks.

❓ Do I need any WordPress plugins for this?

No extra plugin is required for the core publishing flow. If you want SEO meta injection, you need Rank Math installed with its REST API support enabled.

❓ Can I update existing posts with this method?

Yes. Send a POST request to /wp-json/wp/v2/posts/{id} with the fields you want to change — the same authentication and body structure applies as creating a new post.

❓ Is my site secure using Application Passwords?

Yes, as long as you keep them scoped and revoke ones you’re not using. They’re safer than sharing your main login password with a third-party tool since each one can be revoked independently.

I
Written by Iqra Saleem — DevIqra

AI Automation Engineer and WordPress Developer. I build n8n workflows and Python automation systems for clients globally. Everything I write is based on projects I’ve personally built and tested.

What to Do Next

Once your HTTP Request node is authenticated and your first draft post lands successfully, layer in Rank Math meta injection and image uploads one at a time — test each with a draft before wiring it into a live publishing pipeline. In the next post, I’ll walk through the full AI blog automation workflow: generating the article, running it through this exact HTTP setup, and ending with a fully SEO-optimized draft in WordPress without touching the editor.

Related Topics: n8n WordPress integration WordPress REST API Application Passwords Rank Math SEO automation n8n HTTP Request node automated blog publishing
Facebook
Twitter
LinkedIn
Scroll to Top