Automate AI Social Media Publishing from WordPress with n8n

Struggling to craft engaging, platform-tailored social media posts from your WordPress content? This unique n8n workflow leverages AI to generate customized captions and images, automating publishing across Twitter (X), Facebook, LinkedIn, and Instagram, saving hours of manual work with precision and consistency.
manualTrigger
googleSheets
wordpress
+7
Workflow Identifier: 1121
NODES in Use: ManualTrigger, GoogleSheets, Wordpress, Langchain LM Chat OpenRouter, Langchain Output Parser Structured, Langchain OpenAI, Twitter, LinkedIn, FacebookGraphApi, HttpRequest

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 connects WordPress blog posts to social media platforms and automatically creates and posts content with images for Twitter (X), Facebook, LinkedIn, and Instagram.

It solves the problem of manually writing and scheduling posts for each platform.

The result is saving time, avoiding mistakes, and keeping content consistent across all social media accounts.


Who should use this workflow

People managing social media for companies or blogs who want to automate posting new blog content to multiple platforms.

This is useful if manual reposting is slow, prone to errors, or inconsistent in style.


Tools and services used

This setup requires having API keys or tokens for all services mentioned.


How this workflow works (Input → Process → Output)

Inputs

The main input is a WordPress Post ID, stored in a Google Sheets document.

The workflow gets this ID from the sheet to know which blog post to use.

Processing Steps

  1. Fetch WordPress post content: Retrieves full blog content by Post ID.
  2. Generate captions: Uses OpenRouter AI to create custom text for X (Twitter), Facebook, LinkedIn, and Instagram, following each platform’s style rules.
  3. Parse AI output: Converts AI text into structured fields for each platform.
  4. Create images: OpenAI API generates images sized for Instagram (1024×1024) and Facebook/LinkedIn (1792×1024).
  5. Publish posts: Posts texts and images via social media APIs for each platform.
  6. Update status: Flags each platform’s column in Google Sheets to show post was published.

Output

All social media posts with images go live automatically.

The Google Sheets document shows which posts are published per platform.


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

Import the workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. In the n8n editor, click “Import from File” and select the downloaded JSON.
  3. The workflow will appear in the editor, ready to configure.

Configure credentials and IDs

  1. Add or update API credentials for WordPress, Google Sheets, OpenRouter, OpenAI, and social media APIs (X, Facebook, LinkedIn, Instagram).
  2. In the Google Sheets node, confirm the correct spreadsheet ID and sheet name are used.
  3. Make sure the Google Sheets document has the WordPress Post IDs in the right column for input.
  4. If needed, update page or account IDs for social platforms in respective nodes.

Test the workflow

  1. Click the manual trigger button in the Webhook node to run the workflow once.
  2. Check if the post content is retrieved, AI captions generated, images created, and posts published on social media.
  3. Confirm that Google Sheets update the status columns properly.

Activate the workflow

  1. Once tested, switch the workflow to Active in the n8n UI.
  2. Optionally, set up a scheduled trigger or webhook to run automatically when new WordPress posts appear.

If preferred, consider self-host n8n for more control and privacy.


Common problems and edge cases

  • Google Sheets API errors: Caused by wrong Post IDs, missing permissions, or exceeding API limits.
  • WordPress fetch fails: Happens when the Post ID is wrong or API credentials are revoked.
  • AI output empty or malformed: Often from incorrect prompt setup or expired OpenRouter API key.
  • Social media posts fail to publish: Usually due to expired or revoked API tokens, missing permissions, or API changes.

Check API keys, sheet permissions, and correct IDs to fix these issues.


Ideas to customize this workflow

  • Change AI prompts or switch to another supported AI model to adjust text style.
  • Add more social networks by adding relevant nodes and expanding AI prompts.
  • Modify image dimensions or prompts in the OpenAI image generation nodes for different visuals.
  • Replace manual trigger with webhook or cron to automate running when new WordPress posts are published.
  • Use different Google Sheets columns to store extra metadata or track more details.

Summary of results

✓ Time saved by automating social media posting from WordPress blogs.

✓ Reduced errors and consistent brand voice across platforms.

→ Automatic image and text creation designed for each social network’s format.

→ Google Sheets logging helps track publishing status clearly.


Frequently Asked Questions

Yes, the OpenRouter Chat Model node can be replaced with another compatible AI model supported by n8n.
Check API keys for expiry, permissions in the social media apps, and update credentials in n8n if needed.
No, self-hosting is optional. The workflow can run on the n8n cloud or any setup, but self-hosting offers more control.
Google Sheets tracks WordPress Post IDs as input and updates columns after each social media post to show publishing status.

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