How to Automate WordPress Posting with n8n — Step-by-Step Tutorial
Learn how to automate WordPress blog publishing using n8n on N8Nitro — fetch news, generate AI content, create images, and publish automatically.
Publishing blog posts manually can be time-consuming, especially if you manage multiple sites or publish frequently. With n8n and N8Nitro, you can fully automate WordPress posting — from fetching news, generating AI-powered content, creating images, and publishing directly to your WordPress site.
In this guide, you'll learn how to set up a complete WordPress content automation workflow using n8n running on N8Nitro's auto-scaling infrastructure.
Step 1: Connect n8n to WordPress Securely
Before anything else, you need secure API access to your WordPress site. The best method is via Application Passwords, which provide limited, revocable access without exposing your main admin credentials.
Here's how to set it up:
- Log in to your WordPress admin dashboard.
- Go to Users → Profile → Application Passwords.
- Add a name (e.g., "n8n test") and click Add New Application Password.
- Copy the generated password — WordPress will only show it once.
- In your n8n workflow, add a WordPress node → choose Create New Credential.
- Enter your WordPress email as the username and paste the new application password.
- Add your full site URL (e.g., https://yourdomain.com) and click Save.
You should see "Connection tested successfully".
You can revoke this credential any time directly from your WordPress profile — perfect for secure automation setups.
Step 2: Set a Schedule Trigger
Every automation needs a starting point. Add a Schedule Trigger node in n8n and configure it to run daily at 9:00 AM — or any time your audience is most active.
- Mode: Every day
- Time: 09:00
- Purpose: Automatically trigger the workflow to keep your blog active and consistent.
This ensures your blog stays fresh with new posts without manual effort.
Step 3: Fetch News Data for Content
To create content automatically, you'll pull the latest articles from NewsData.io, a free news API.
- Add an HTTP Request node.
- Set Method: GET
- API Endpoint: https://newsdata.io/api/1/news
Add Query Parameters:
apikey: your API key
category: technology
language: en
country: us
size: 1
Click Test Step and you'll receive a JSON response containing the latest news articles — including titles, descriptions, and content.
Step 4: Generate a Blog Post with OpenAI
Now that you have a news article, use AI to rewrite it as a high-quality blog post.
- Add an OpenAI node → select Message a Model.
- Choose Model: gpt-4-turbo (or gpt-3.5-turbo for faster runs).
System prompt:
You excel at transforming news into interesting articles without plagiarism.
User prompt:
Write a completely original blog post about this news:
Title: {{title}}
Description: {{description}}
Requirements:
- Create a unique and engaging title.
- Write exactly 5 paragraphs, each wrapped in <p> tags.
- Include your own analysis and conclusion.
- Do not copy phrases from the source.
Output format: Clean JSON with title and content fields.
This ensures each article is well-structured, original, and SEO-friendly.
Step 5: Clean and Parse the AI Output
Add a Function node to parse the JSON response from OpenAI.
This simple JavaScript snippet extracts only the clean title and content from the model output, ensuring it's ready for publishing.
Step 6: Generate an Image Automatically
No blog post is complete without a featured image. Let's generate one using DALL·E 3 via OpenAI:
- Add another OpenAI node → choose Image Generation.
Prompt example:
Create a professional illustration showing {{title}}.
The image should reflect key themes from this content: {{content.substring(0,200)}}.
- Choose image model dall-e-3, set quality and size preferences.
- Test the node — you'll get a unique image perfectly matched to the post topic.
Step 7: Resize and Upload the Image to WordPress
Before uploading, resize the image for optimal performance:
- Add an Edit Image node → operation Resize Image.
- Recommended dimensions: 1340×638 px.
- Then, add an HTTP Request node to upload the image:
Method: POST
Endpoint: https://yourdomain.com/wp-json/wp/v2/media
Headers:
- Content-Disposition: attachment; filename=image.png
Body: Binary file from the previous node
The response returns the uploaded image ID — needed for the next step.
Step 8: Merge Image and Content Data
Add a Merge node and combine:
- Output from your AI content branch
- Output from your image upload branch
Set Mode: Combine by position → Inputs: 2
Now you have both the post content and image ID in one clean data item.
Step 9: Publish the Post to WordPress
Finally, add another HTTP Request node:
Method: POST
Endpoint: https://yourdomain.com/wp-json/wp/v2/posts
Body Type: JSON
{
"title": "{{title}}",
"content": "{{content}}",
"status": "publish",
"featured_media": "{{image_id}}"
}
Click Execute Workflow, and within seconds your new article will be live — complete with a featured image and SEO-ready formatting.
Step 10: Schedule and Automate Forever
Once you confirm it's working, toggle your workflow ON in the top-right corner.
From now on, n8n will automatically:
- Fetch new articles,
- Generate rewritten AI content,
- Create visuals,
- Publish to WordPress — all without manual work.
The Result
You've now built a fully automated content engine powered by n8n and hosted on N8Nitro's auto-scaling cloud.
Your WordPress site stays fresh, relevant, and optimized — while you focus on strategy, not scheduling.
Optional Enhancements
- Add social-media nodes (Twitter/X, LinkedIn) to auto-share new posts.
- Add email notifications when new articles go live.
- Experiment with different AI writing styles or tones.
Final Thoughts
With N8Nitro, deploying and scaling n8n workflows is effortless — no servers, no DevOps.
Automating your WordPress publishing process is just one of the endless possibilities for building intelligent, self-sustaining systems.
Frequently asked questions
Is it safe to connect n8n to WordPress?
Yes, use an Application Password. It gives limited access, is shown once, and you can revoke it at any time from your WordPress profile without touching your main password.
Which AI model writes the posts?
The tutorial uses OpenAI models, but any model n8n supports can be swapped in.
Can I review posts before they go live?
Yes. Publish as drafts first and add an approval step, especially for AI-written content.
How often can the workflow run?
As often as you schedule it. The tutorial runs once a day at 9:00 AM with a Schedule Trigger.
Do I need to run n8n on my own server?
No. You can use n8n on any host. The guide runs it on N8Nitro so there is nothing to maintain.