n8n

How to Automate WordPress AI Content Publishing?

Turn ideas into live posts without manual work. The flow writes long form articles with AI, saves them to Google Sheets, fetches a matching image from Pexels, and publishes to WordPress on a smart schedule. It fits small teams that need steady blog output with low effort.

A schedule starts the run on chosen days and time. A code step makes a random delay up to six hours, and a wait step holds the job to avoid a predictable pattern. OpenAI builds a JSON package with a title, HTML body, and image keywords. The Google Sheets step stores these fields for tracking. An HTTP call asks Pexels for one landscape image that matches the keywords. The WordPress step injects that image at the top of the article and publishes it.

Set up Google Sheets, OpenAI, Pexels, and WordPress credentials. Expect a big cut in publishing time and a consistent posting rhythm. This is useful for blogs, affiliate sites, and content teams that want hands off publishing while keeping clean structure and SEO friendly headings.

What are the key features?

  • Scheduled runs with weekly day and hour control to queue posts on specific days.
  • Random delay generator up to six hours using a code node and a wait node for natural timing.
  • AI article builder that returns title HTML content and 3 to 5 image keywords in JSON.
  • Google Sheets append stores title content and keywords for history and edits.
  • Pexels image fetch via API returns one landscape image matched to the article keywords.
  • WordPress post creation publishes immediately and injects the image at the top of the post.
  • Manual test trigger available for safe dry runs before enabling the schedule.
  • Optional featured image support when the site uses a plugin that reads image URLs from content.

What are the benefits?

  • Reduce manual blog prep from 2 hours to 10 minutes
  • Automate 80 percent of writing formatting and posting
  • Lower copy paste errors by 90 percent with direct field mapping
  • Handle 5 times more posts per week with the same team
  • Connect WordPress Google Sheets OpenAI and Pexels in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with WordPress, Google Sheets, OpenAI and Pexels. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, open the WordPress node and create a new WordPress credential. Enter your site URL and an application password or login as requested, then save.
  4. Open the Google Sheets node and choose Create new credential. Connect your Google account to allow read and write access to your sheet.
  5. Open the OpenAI node and create a new OpenAI API Key credential. Get the key from your OpenAI account API page and paste it in, then save.
  6. Open the HTTP Request node for Pexels. In Headers, replace YOUR_PEXELS_API_KEY with your key from the Pexels API dashboard.
  7. In the Google Sheets node, set Document URL to your Sheet and Sheet name to the target tab. Keep the field mapping for title content and keywords as shown.
  8. Open the OpenAI node prompt and review the JSON format instructions. Adjust the prompt text to match your topic and tone while keeping the required JSON fields.
  9. Check the Schedule node days and hour. Edit them to match your posting plan. Save the workflow.
  10. Right click the Processing Delay node and choose Execute Node to run a test through the chain. Confirm a new row appears in Google Sheets and a post is created in WordPress.
  11. If you want a featured image, install and configure a plugin on WordPress that sets featured images from image URLs as noted in the workflow notes.
  12. If the post is missing an image, verify the Pexels API key and that the keyword field reaches the HTTP Request node. Review the execution log to see the query and response.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Pexels

Sign up

Free API: $0, default limits 200 requests/hour and 20,000 requests / mo; unlimited free upon approval

WordPress

Sign up

Free plan: $0 / mo (WordPress.com REST API supports creating posts)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.