Automate WordPress Content Creation with n8n & AI

This workflow automates generating SEO-optimized articles using AI and publishes them on WordPress with images from Pexels. It helps content creators save hours by scheduling randomized post publishing while keeping articles visually appealing and structured.
code
wait
openAi
+4
Workflow Identifier: 1171
NODES in Use: code, wait, openAi, googleSheets, httpRequest, wordpress, scheduleTrigger

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow makes new blog posts by using AI and gets pictures automatically. It solves the problem of spending too much time writing and finding images for posts on WordPress. It creates well-structured articles with images and posts them at random times to look natural.

The workflow takes a schedule, waits a bit, creates content, finds images, saves info to a sheet, and posts on WordPress with pictures set as featured images automatically.


Who should use this workflow

People who run WordPress blogs but find writing and publishing posts slow and hard. Non-technical marketers or small team members wanting to save time and keep posts regular benefit.

No deep technical skill needed, but user should have API keys and access to services used. Good for those looking to automate content creation with AI and automated image search.


Tools and services used

  • n8n: To build and run workflow automation.
  • OpenAI GPT-4o API: To generate full articles with HTML formatting.
  • Google Sheets: To save article data and keywords.
  • Pexels API: To get free high-quality images matching keywords.
  • WordPress REST API: To post articles and images automatically.
  • Featured Image from URL (FIFU) plugin: To set featured image from inline images.

Users relying on self-host n8n can use self-host n8n for better control and security.


Beginner step-by-step: How to build this in n8n for production

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Go to the n8n editor where you work on workflows.
  3. Click on “Import from File” and select the downloaded workflow.

Step 2: Configure credentials and settings

  1. Add your OpenAI API key in the OpenAI node credentials.
  2. Set your Google Sheets OAuth2 credentials in the Google Sheets node.
  3. Enter your Pexels API key in the HTTP Request node header.
  4. Configure your WordPress site API URL and username/password or application password in the WordPress node.
  5. Check and update Google Sheet name, column names if different.
  6. Update list of posting days or time in the Schedule Trigger.

Step 3: Test the workflow

  1. Run the workflow manually once to check for errors.
  2. Verify that the article is generated, saved to Google Sheets, image fetched from Pexels, and a post appears on WordPress.

Step 4: Activate for production

  1. Activate the Schedule Trigger to run on planned days automatically.
  2. Monitor initial runs in execution logs inside n8n to catch any issues.

This simple import and configure method avoids building from scratch. Follow these steps carefully in your n8n instance. For more control, consider self-host n8n.


Workflow inputs, processing, and outputs

Inputs

  • A schedule trigger for posting days and time.
  • OpenAI prompt requesting a detailed HTML article and image keywords.
  • Google Sheet ID and OAuth for storing data.
  • Pexels API key for image search queries.
  • WordPress API credentials and site URL.

Processing steps

  1. Schedule Trigger fires the workflow on selected days.
  2. Code node creates a random delay up to 6 hours.
  3. Wait node pauses workflow using generated delay.
  4. OpenAI node generates a full SEO article with headings, paragraphs, lists, and keywords output as JSON.
  5. Google Sheets node appends generated article title, content, and image keywords.
  6. HTTP Request node sends request to Pexels API using keywords to get top landscape image.
  7. WordPress node creates a new post with full HTML content including the image and enables featured image auto-setting using the FIFU plugin.

Outputs

  • New blog post on WordPress with well-structured HTML content and inline image.
  • Featured image set automatically using the URL image and FIFU plugin.
  • New row appended to Google Sheets with article data and keywords.
  • Posts published at randomized times to look natural.


Customizations

  • Change the Schedule Trigger to post daily or monthly.
  • Edit OpenAI prompt to match different topics or writing styles.
  • Get multiple images from Pexels by increasing per_page or adding more queries.
  • Set WordPress post status to draft for review instead of publishing immediately.
  • Expand AI prompt to include tags or categories for WordPress.


Troubleshooting

Issue: WordPress posts do not have images.

Cause: FIFU plugin missing or not set for auto-featured image.

Fix: Install the Featured Image from URL (FIFU) plugin and enable automatic featured image setting in plugin settings.

Issue: Google Sheets rows not updating.

Cause: Wrong sheet name or column headers.

Fix: Verify Google Sheet ID and that columns match exactly: title, content, Image search keyword.

Issue: OpenAI node fails or no output.

Cause: Bad API key or JSON formatting errors in prompt.

Fix: Confirm OpenAI API key is correct and prompt output is valid JSON as expected.


Pre-Production checklist

  • Confirm all API keys and credentials are properly set in n8n.
  • Test OpenAI node separately for correct article generation.
  • Check Google Sheets connection and exact sheet name with columns.
  • Run Pexels HTTP request node with sample keywords to verify images come back.
  • Test WordPress node posting a draft before publishing.
  • Verify schedule trigger days and time settings.


Deployment guide

After testing, activate the Schedule Trigger node to run automatically. Watch logs for runtime success or errors. Keep manual execution logs for tracking. Adjust prompt, timing, or schedule if needed to improve quality and SEO.


Summary

✓ Saves time by automating full blog post creation and publishing.

✓ Produces SEO-ready, well-formatted articles with relevant images.

✓ Auto-sets featured images on WordPress posts using FIFU plugin.

→ Posts published at random times to look natural.

→ Keeps consistent posting schedule without manual effort.

Frequently Asked Questions

Yes, the HTTP Request node can be changed to call any image API that returns usable URLs by adjusting the API endpoint and headers.
Long, detailed articles consume more OpenAI tokens, so monitor usage to balance cost and output.
WordPress API credentials are stored safely inside the n8n instance. Using self-host n8n improves security control.
Yes, with correct schedule settings and respecting API limits, high posting volume is possible.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free