AI Content Publisher with WordPress and Pexels - n8n Workflow

Automate AI content generation, image sourcing via Pexels, and instant publishing to WordPress using this powerful n8n workflow. Manage topics in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

SEO Managers: Seeking to scale content creation rapidly without manual steps.
Content Agencies: Needing reliable, automated content pipelines.
Bloggers & Publishers: Who want to leverage n8n templates to automate WordPress publishing.
n8n Users: Looking for advanced examples combining LLMs, external APIs (Pexels), and core CMS operations.

Overview

Scaling content generation often involves tedious manual steps: ideation, writing, image sourcing, and publishing. This sophisticated n8n workflow streamlines this entire process. It uses a Google Sheet as a centralized content calendar, allowing users to queue up topics (or use AI to generate new ones). Once triggered, the n8n workflow utilizes the Gemini model for high-quality, SEO-optimized article generation, finds a relevant royalty-free image using the Pexels API, and handles all the necessary steps—uploading and setting the featured image—before publishing the completed post to WordPress. This provides a robust, self-managing automation solution.

How it Works

The entire process is initiated by an n8n trigger (the 'Form Trigger: Select Action' node), which presents the user with two main options: generating new ideas or generating content.

Content Generation Flow (Publishing)


  1. Idea Fetching: The n8n workflow starts by querying Google Sheets (using the 'Fetch Unprocessed Ideas' n8n node) for topics where the 'Generated' column is marked 'no'.

  2. Article Creation: The topic is passed to the 'Generate Article AI' n8n node (powered by Gemini), which produces a full, HTML-formatted article based on extensive, SEO-focused instructions defined in the n8n workflow prompt.

  3. Image Keyword Extraction: Simultaneously, the 'Generate Image Keyword AI' n8n node determines the best query for Pexels to ensure visual relevance.

  4. Image Sourcing: An HTTP Request n8n node ('Search Pexels Image') uses the keyword and Pexels API key to find a suitable image URL.

  5. WordPress Post Creation: The 'Create WordPress Post' n8n node publishes the AI-generated content and title to WordPress.

  6. Media Handling: The n8n workflow downloads the image file via the 'Download Pexels Image' n8n node, then uses two subsequent HTTP Request n8n nodes ('Upload Image' and 'Set Featured Image') to upload the media to WordPress and assign it as the featured image for the new post.

  7. Sheet Update: Finally, the 'Update Google Sheet' n8n node marks the row as 'Generated: yes', recording the post ID and final title, thereby completing the full automated n8n workflow cycle.

Idea Generation Flow (Optional)


  1. If 'Add Ideas' is selected, the user inputs a general subject via a form.

  2. The 'Generate Blog Topics AI' n8n node creates five SEO-optimized blog titles related to the subject.

  3. These topics are parsed, split, and appended to the Google Sheet using the 'Add Ideas to Sheet' n8n node, awaiting subsequent processing by the main content generation flow. Users can then loop back to generate more ideas.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance.

  2. Credentials Setup:

Set up Google Sheets credentials for all related nodes.
Set up WordPress API credentials for the 'Create WordPress Post', 'Upload Image', and 'Set Featured Image' n8n nodes.
* Set up Google Gemini API credentials for the language model nodes (Gemini Model for Article, etc.).

  1. API Key Configuration: In the 'Search Pexels Image' n8n node, update the Authorization header with your Pexels API key.

  2. WordPress URL Update: In the 'Upload Image' and 'Set Featured Image' n8n nodes, replace WORDPRESSURL> with the actual URL of your WordPress site.

  3. Google Sheet Configuration: Verify the Document ID and Sheet Name in all Google Sheets n8n nodes ('Fetch Unprocessed Ideas', 'Add Ideas to Sheet', 'Update Google Sheet') match your setup.

  4. Activation: Activate the n8n workflow. The n8n trigger can be executed via the generated webhook URL.

Node Details

Form Trigger: Select Action: The primary n8n trigger. Starts the workflow and dictates whether the process will generate topics or generate content.
Google Sheets (Fetch Unprocessed Ideas): Reads content ideas from a Google Sheet where the Generated column is 'no'. Essential for queue management within the n8n workflow.
LangChain Agent (Generate Article AI): Uses Gemini to generate long-form, structured HTML content based on detailed SEO guidelines.
LangChain Agent (Generate Image Keyword AI): Utilizes AI to distill the main topic into a concise, relevant search query for the Pexels API.
HTTP Request (Search Pexels Image): Connects to the Pexels API using the extracted keyword to find the source image URL.
WordPress (Create WordPress Post): Publishes the final article content to your WordPress site. This n8n node handles the initial post creation.
HTTP Request (Upload Image & Set Featured Image): These n8n nodes manage binary file upload and API interaction required to set the cover image for the new WordPress post.
Google Sheets (Update Google Sheet): Marks the processed item as 'Generated: yes' and records the post details, ensuring the n8n workflow does not re-process the same idea.

Related n8n Workflows

Free

Nodes: 12 Nodes
Updated: December 26 2025
View all
Created by

Featured*