Automate Your Blog with AI : The Complete N8N News-to-WordPress Tutorial

Discover how to auto-publish tech news blogs daily using n8n and AI. Learn how to set up this proven workflow instantly ; no coding needed!

Struggling with posting blog daily ? There’s a way to automatically fetch trending tech news, turn it into unique blog posts, and publish them to WordPress ; all without lifting a finger? Sounds too good to be true ? But here’s the thing: automation isn’t magic anymore. In this guide, I’ll walk you through setting up a powerful n8n workflow that does exactly this. By the end, you’ll have your own AI-powered blogging machine running 24/7.

A workflow automation interface showing a sequence of connected nodes: Schedule Trigger, HTTP Request (GET to newsdata.io API), OpenAI Message Model, Code block, and HTTP Request2 (POST to elraa.in). The interface has a dark theme with Editor, Executions, and Evaluations tabs at the top, and an Execute workflow button at the bottom. A Tools section is visible in the center with an add button.

What Exactly Is This Workflow?

Think of this workflow as your personal blogging assistant. It wakes up every morning at 9 AM, grabs the latest technology news from NewsData.io, rewrites it into a fresh blog post using OpenAI, and publishes it directly to your WordPress site. No copy-pasting. No manual work. Just automatic content.

The beauty here? This isn’t some complicated coding project. We’re using n8n, a visual automation tool that connects different apps together like LEGO blocks. You drag, drop, connect, and boom ; you’re done .

Get Your N8n Template – Start Building

Before We Start: What You’ll Need

Let’s get our ducks in a row. Here’s everything you need before jumping in:

Required Accounts:

  • n8n account (cloud or self-hosted)

N8N Free Access For 14 Days “TRY NOW”

  • NewsData.io API key (free tier gives you 200 requests daily)
  • OpenAI API account with credits
  • WordPress site with admin access

Now we dive into the real part

Step 1: Setting Up the Schedule Trigger

Every automation needs a starting point ; a trigger that kicks everything into motion. We’re using the Schedule Trigger node, which acts like an alarm clock for your workflow.

Here’s how to set it up:

Open your n8n workspace and click the big “+” button. Search for “Schedule Trigger” and drag it onto your canvas. Now click on the node to open its settings.

Schedule Trigger configuration panel with Parameters tab active. Left side shows trigger settings including: Trigger Interval set to 'Days', Days Between Triggers set to '1' (range 1-31), Trigger at Hour set to '9am', and Trigger at Minute set to '0'. An 'Add Rule' button appears at bottom. A tooltip explains the workflow runs on the defined schedule once published, and can be manually triggered via 'execute workflow'. Right side shows OUTPUT section with 'No trigger output' message and options to 'Test this trigger' or 'set mock data'.

The configuration looks like this:

  • Mode: Hour
  • Hour: 9
  • Minute: 0

That’s it. Your workflow now has a heartbeat.

Step 2: Fetching News with HTTP Request

Now that we have our trigger, we need content. This is where NewsData.io comes in—a powerful news API that delivers fresh articles from thousands of sources worldwide.

Setting up the HTTP Request node:

Add a new node by clicking the “+” next to your Schedule Trigger. Search for “HTTP Request” and select it. Connect the Schedule Trigger to this new node by dragging a line between them.

Now let’s configure the request. Change the method to GET and enter this URL:

But here’s where it gets interesting. We need to add query parameters to tell the API exactly what we want. Click “Add Parameter” and create these five entries:

Parameter 1:

  • Name: apikey
  • Value: pub_f1095321884a440bb0a5a8b618ef4923 (replace with your own key)
HTTP Request node configuration panel displaying INPUT section on left with Schedule Trigger and Variables and context options with Preview button. Center Parameters section shows GET method, URL 'https://newsdata.io/api/1/news', Authentication set to None, Send Query Parameters toggle enabled, Specify Query Parameters set to 'Using Fields Below', and Query Parameters with Name 'apikey' and Value 'pub_f10953218844a44bb0a5a8b618ef4923'. OUTPUT section on right shows 'Execute step' button with 'set mock data' option.

Parameter 2:

  • Name: category
  • Value: technology

Parameter 3:

  • Name: language
  • Value: en

Parameter 4:

  • Name: country
  • Value: us
HTTP Request node configuration showing INPUT section on left with Schedule Trigger and Variables and context options with Preview button. Center Parameters section displays three query parameter pairs: 'category' with value 'technology', 'language' with value 'en', and 'country' with value 'us'. OUTPUT section on right shows 'Execute step' button with option to 'set mock data'.

Parameter 5:

  • Name: size
  • Value: 1

Let me break down what each parameter does. The API key authenticates your requests. Category filters for tech news only—you could change this to “sports” or “business” if you want. Language ensures English articles. Country focuses on US news sources. And size? That tells the API to send just one article per request. Why one? Because we’re publishing daily, and quality beats quantity.

Step 3: The Magic Happens—AI Content Creation

This is where things get exciting. We’re about to transform a boring news snippet into an engaging blog post using OpenAI’s GPT model.

Connecting OpenAI:

Add an “OpenAI” node to your canvas and connect it to the HTTP Request node. You’ll need to set up credentials first. Click “Create New Credential” and enter your OpenAI API key.

Now here’s where the magic formula lives—in the messages section. We’re giving GPT two messages: a system message and a user message.

System Message:

You are an expert blog writer who creates engaging, original content. You excel at transforming news into interesting articles without plagiarism.

This sets the tone. We’re telling the AI to act as a professional writer, not a news copier.

User Message:

Write a completely original blog post about this news:
Title: {{ $json.results[0].title }}
Description:{{ $json.results[0].description }}

Requirements:
- Create a unique and engaging title
- Write EXACTLY 5 separate paragraphs (each in its own <p> tag)
- Include your own analysis and perspective
- Do NOT copy phrases from the original source
- End with a thoughtful conclusion

Format the response as clean JSON without backticks:
{
  "title": "Your creative blog title",
  "content": "The full blog post content with HTML formatting including separate <p> tags for each paragraph"
}

Notice those curly braces? That’s n8n’s way of pulling data from the previous node. We’re grabbing the news title and description and feeding it to OpenAI.

The model we’re using is “gpt-4.1-nano-2025-04-14″—a fast, cost-effective option perfect for blog writing. It’s cheaper than GPT-4 but still delivers quality content.

Publishing content is great but closing clients is better.

If you’re doing outreach, don’t miss this:

“How I Automate Personalized Cold Email Icebreakers (Using and n8n). Which Increased My Reply Rate To 10%

Step 4: Cleaning Up the Response with Code

OpenAI sends back a text response, but we need clean JSON data to work with. That’s what the Code node does ; it parses the response and extracts just what we need.

Setting up the Code node:

Add a “Code” node after OpenAI and paste this JavaScript:

const response = items[0].json.message.content;
const parsed = JSON.parse(response);
return [
  {
    json: {
      title: parsed.title,
      content: parsed.content
    }
  }
];

The first two pull data from our Code node using those curly braces again. The third one tells WordPress to publish immediately. If you want drafts instead, change “publish” to “draft.”

Code node configuration panel showing INPUT section on left with OpenAI node preview, Parameters section in center displaying Mode set to 'Run Once for All Items', Language set to 'JavaScript', and a code editor containing JavaScript that parses JSON response data and extracts title and content fields. A tooltip at bottom explains typing $ for special variables/methods and using console.log() for debugging. OUTPUT section on right shows 'Execute step' button with 'set mock data' option.

Let me explain what’s happening here.

First line grabs the OpenAI response. Second line converts it from text into actual JSON.

Then we return only the title and content fields, ignoring everything else. Why do we need this? Because WordPress expects specific data fields.

This code node acts as a translator between OpenAI’s response and WordPress’s requirements.

Step 5: Publishing to WordPress

The final piece of the puzzle ; actually getting your blog post live on your website.

Configuring the WordPress HTTP Request:

Add another HTTP Request node, but this time we’re using it to talk to WordPress.

Change the method to POST and enter your WordPress REST API URL:

https://yourdomain.com/wp-json/wp/v2/posts

(Replace “yourdomain.com” with your actual site URL)

Now here’s the security part. WordPress needs authentication.

Click on “Authentication” and select “Predefined Credential Type.”

HTTP Request2 node configuration panel showing INPUT section on left with OpenAI node preview, Parameters section in center displaying POST method, URL 'https://eliraa.in/wp-json/wp/v2/posts', Authentication set to 'Predefined Credential Type' with 'Wordpress API' credential type and 'Wordpress account' selected, Send Query Parameters toggle disabled, Send Headers toggle disabled, and Send Body section at bottom. OUTPUT section on right shows 'Execute step' button with 'set mock data' option.

Choose “WordPress API” and enter your WordPress credentials.

You’ll need an application password from your WordPress admin panel ; not your regular login password.

Adding Body Parameters:

Click “Send Body” and add these three parameters:

Parameter 1:

  • Name: title
  • Value: ={{ $json.title }}

Parameter 2:

  • Name: content
  • Value: ={{ $json.content }}

Parameter 3:

  • Name: status
  • Value: publish
HTTP Request2 node configuration showing INPUT section on left with OpenAI node preview, Parameters section in center with Send Body toggle enabled, Body Content Type set to 'JSON', Specify Body set to 'Using Fields Below', and Body Parameters containing two fields: 'title' with value '{{ $json.title }}' and 'content' with value '{{ $json.content }}'. OUTPUT section on right displays 'Execute step' button with 'set mock data' option.

The first two pull data from our Code node using those curly braces again. The third one tells WordPress to publish immediately. If you want drafts instead, change “publish” to “draft.”

Common Issues and Fixes:

If the NewsData node fails, double-check your API key. If OpenAI errors out, verify you have credits in your account. If WordPress returns a 401 error, your authentication needs fixing—regenerate your application password.

Going Live: Activating Your Workflow

Once testing works perfectly, flip the switch. At the top of your workflow, you’ll see an “Active” toggle. Turn it on.

That’s it. Your workflow is now live and will run automatically every day at 9 AM. You can check the “Executions” tab to see the history of all past runs. Each execution shows you exactly what happened, what data passed through, and whether it succeeded or failed.

Final Verdict : Your Automated Future Starts Now

You’ve just built a self-running blog that publishes daily without constant attention. This workflow handles repetitive tasks so you can focus on growing your audience and building your brand.

But remember: automation is your assistant, not your replacement. Use it to maintain consistency, but don’t abandon your unique voice. Let it handle daily news while you create the premium, in-depth content only you can write. So flip that Active switch and enjoy the freedom—but use that extra time to engage with readers and craft content that truly showcases your expertise. Welcome to smarter blogging.

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *