使用Wordpress和ChatGPT自动生成博客文章
高级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 Xml, Code, Wordpress, HttpRequest, ScheduleTrigger 等节点。 支持定时或触发式生成WordPress内容的AI博客文章生成器
前置要求
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "kT6Enn9B13D5YHX8",
"meta": {
"instanceId": "0aa128a42ecb7507b467e5a40bd7404c487cacc38f4e5db3c23146b9172660bf",
"templateId": "3018",
"templateCredsSetupCompleted": true
},
"name": "使用Wordpress和ChatGPT自动生成博客文章",
"tags": [],
"nodes": [
{
"id": "52911348-2e1a-4cb6-af35-c245e2402f25",
"name": "由 Github 模型提供支持",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
784,
320
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "6063c151-0c5c-4f6a-89cc-821be284f634",
"name": "聊天消息",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
784,
544
],
"webhookId": "f23328b1-5498-43a4-aed3-2bd0337d29e3",
"parameters": {
"options": {
"allowFileUploads": false
}
},
"typeVersion": 1.1
},
{
"id": "65399934-119e-4f3d-ac0a-9354d2feaa1c",
"name": "选择正确的",
"type": "n8n-nodes-base.code",
"position": [
1616,
544
],
"parameters": {
"jsCode": "// Verifica se `chatInput` existe no JSON\nif ($json.chatInput) {\n return [{ json: { result: $json.chatInput } }];\n} \n// Caso contrário, verifica se `message.content` existe no JSON\nelse if ($json.message && $json.message.content) {\n return [{ json: { result: $json.message.content } }];\n}\n// Caso nenhum dos dois existam, retorna um valor padrão (opcional)\nelse {\n return [{ json: { result: 'Nenhuma entrada encontrada' } }];\n}\n"
},
"typeVersion": 2
},
{
"id": "993dc632-d742-4357-9446-cc075d8ff396",
"name": "[聊天] 排序Slug",
"type": "n8n-nodes-base.code",
"position": [
1328,
544
],
"parameters": {
"jsCode": "// Acessa o array de URLs do JSON\nconst urls = items[0].json.urlset.url;\n\n// Extrai os slugs das URLs\nconst slugs = urls.map(url => {\n const urlString = url.loc; // Pega o valor da tag <loc>\n const slug = urlString.split('/').filter(Boolean).pop(); // Extrai a última parte da URL\n return slug;\n});\n\n// Retorna os slugs de forma correta, dentro do formato esperado pelo n8n\nreturn [\n {\n json: {\n slugs: slugs // Aqui a chave 'slugs' é um array de slugs extraídos\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "46e54e20-4292-4e00-8531-c7930d616111",
"name": "[聊天] 站点地图转JSON",
"type": "n8n-nodes-base.xml",
"position": [
1136,
544
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "508fe15b-f0f7-4cbf-9d17-0b67794c43cf",
"name": "[聊天] 获取站点地图",
"type": "n8n-nodes-base.httpRequest",
"position": [
960,
544
],
"parameters": {
"url": "https://bruzzi.online/sitemap.xml",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "861bbd03-9f34-4c00-9df5-344a009e4634",
"name": "[计划] 获取站点地图",
"type": "n8n-nodes-base.httpRequest",
"position": [
960,
320
],
"parameters": {
"url": "https://bruzzi.online/sitemap.xml",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "775fe67d-1146-45a8-ad06-15ce3c0dfed8",
"name": "[计划] 站点地图转JSON",
"type": "n8n-nodes-base.xml",
"position": [
1136,
320
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "ac79601b-bb46-4b5b-b6b0-781cdd929b13",
"name": "[计划] 排序Slug",
"type": "n8n-nodes-base.code",
"position": [
1328,
320
],
"parameters": {
"jsCode": "// Acessa o array de URLs do JSON\nconst urls = items[0].json.urlset.url;\n\n// Extrai os slugs das URLs\nconst slugs = urls.map(url => {\n const urlString = url.loc; // Pega o valor da tag <loc>\n const slug = urlString.split('/').filter(Boolean).pop(); // Extrai a última parte da URL\n return slug;\n});\n\n// Retorna os slugs de forma correta, dentro do formato esperado pelo n8n\nreturn [\n {\n json: {\n slugs: slugs // Aqui a chave 'slugs' é um array de slugs extraídos\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "0cdf1e26-abf1-43dc-973d-21c4c77e3262",
"name": "[计划] 新博客文章主题",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1504,
320
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-5-nano",
"cachedResultName": "GPT-5-NANO"
},
"options": {},
"messages": {
"values": [
{
"content": "=Give me a relevant topic for my blog. I want only the topic. I have a [area] blog for [your persona], and I want something relevant for this audience. Return only the topic.\n\nDo not repeat topics. Below is the list of current topics on my blog. Always focus on a new area/subarea when a topic already exists.\n\nList of existing topics (in slug): {{ $json.slugs }}\n\nReturn only one sentence, without - or other symbols. This will be our topic. Do not send it in slug form.\n"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "Tf4ac3A66loxAGyo",
"name": "OpenAi account"
}
},
"typeVersion": 1.8
},
{
"id": "27b5d043-7dff-4b5a-984c-cc1ddb66c536",
"name": "创建文章",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
992,
752
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini-search-preview",
"cachedResultName": "GPT-4O-MINI-SEARCH-PREVIEW"
},
"options": {},
"messages": {
"values": [
{
"content": "=You are a generator of deep and comprehensive content for a [area] blog. The blog is focused on [your persona]\n\nFrom the provided topic ({{ $('Choose Right One').item.json.result }}), you will write a title, and from that title, you will write a complete blog post. The title must have up to 12 words and up to 60 characters, including spaces.\n\nEnsure the content is highly accurate. It will be read and reviewed by other professionals.\n\nThe current blog topics (slugs) are: {{ $json.slugs }} — use them throughout the text, along with external links, to increase the reliability of my site. Do not use “openai referrer” or relative links; always use the original link and nothing else. Understand whether I’m sending you a complete piece of content or a specific topic. Feel free to create, recreate, or adjust it according to a relevant, current, and sensible blog theme. The content to be developed in the post is\n\nEnsure you provide the most up-to-date information from guidelines, protocols, directives, articles, and similar relevant online publications when relevant for building this content.\n\nKeywords must be specific objects, places, or atmospheres—not abstract concepts.\n\n**Article Formatting Requirements**\n\n1️⃣ **Title (H1):** Ensure unique and assertive titles aligned with user search intent.\n2️⃣ **Subtitles (H2 / H3):** Structure the content for SEO optimization.\n3️⃣ **Article Structure (Enhanced Readability):**\n\n**Introduction**\nGo straight to the point, avoiding long or generic introductions.\nUse engaging questions or market trend data to capture the reader’s attention.\n\n**Main Content**\nInclude at least three key knowledge points for depth.\nBalance short and long sentences for fluent reading.\nBe thorough, accurate, and descriptive. Ensure the content is extremely relevant and complete, aiming for 3,000–7,000 words.\n\nInclude internal links to similar posts distributed throughout the text. \n\nThe base URL for my blog posts is [https://yourblog.com/blog/[slug](https://yourblog.com/blog/[slug)]. Insert 1–5 internal links, always matching keywords meaningfully.\n\n**Final Section**\nAvoid generic AI-style summaries; instead, provide insights or practical actions. Do not use the word “conclusion” or similar terms—just complete your reasoning naturally.\n\n**HTML Formatting**\nEnsure the article is properly structured in HTML format:\n\n* Titles: Use <h1>, <h2>, <h3> appropriately.\n* Paragraphs: Wrap text in <p>.\n* Highlighted Words: Use <strong> to emphasize important terms.\n* Lists: Use <ul> and <li> for bullet points.\n Keep the output clean and well-structured, avoiding plain text. Never include suggestions or comments in your responses.\n\n**Final JSON Format**\n\n```json\n{\n \"title\": \"{Generate an H1 title aligned with market trends, with high click potential, following the keyword strategy. The title should use capitalization only for the first word or proper nouns'}\",\n \"content\": \"{Generate a complete article in HTML including H1, H2, H3 titles, paragraphs, lists, etc.}\",\n \"slug\": \"{Generate a unique, SEO-friendly slug with as few words as possible (minimum of 2), separated by hyphens, such as gina-2025 or 10-better-choices. Do not use accents or similar characters, as they cause issues in some browsers.}\"\n}\n```\n"
}
]
}
},
"credentials": {
"openAiApi": {
"id": "Tf4ac3A66loxAGyo",
"name": "OpenAi account"
}
},
"typeVersion": 1.6
},
{
"id": "c89b3836-c12d-49fc-8855-d32d4e220069",
"name": "审阅文章",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1280,
752
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-5-mini",
"cachedResultName": "GPT-5-MINI"
},
"options": {},
"messages": {
"values": [
{
"content": "=You are a WRITER AND EDITOR of content for a [area] blog. The blog is focused on [your persona]\n\nYou will not receive the title, content, or slug — you will create them to be read by either professionals or laypeople.\n\nYour task is to receive the inputs and return a title, content, and slug, in the provided format.\n\nThe content must be well-written, following correct spelling, grammar, and syntax rules.\n\nIt should be relevant, written by a professional in accessible yet professional language. Ensure the SEO is extremely strong and relevant to the keywords covered in the topic.\n\nThe content must include at least three related keywords throughout the post. Never mention the term “keywords” or related expressions. They must be inserted contextually and naturally within the text.\n\nThe title should use capitalization only for the first word or proper nouns.\n\nThe post must go straight to the point — do not use terms like “Main Content,” “Content,” or similar. Always use H2 and H3 for referencing the keyword(s) of the post. The same applies to the conclusion: avoid terms like “Conclusion,” “Closing,” or related words. Go directly to your final reasoning. Insert relevant keywords only within the text, in a valid and meaningful context. Never insert them at the end of the text. The post body must contain only the title, slug, and content.\n\nReview and edit all internal links in the post. Consider removing them if they are poorly placed, out of context, or inserted mechanically (for example, “Useful links already inserted in the original text” or “Relevant links I’ve selected for you”). These should be corrected.\n\nEnsure the post contains at least three internal links from my site (formatted as https://yoursite.com/blog/[slug]) in relevant keyword contexts. The available internal link slugs are:\n{{ $('[CHAT] Order Slugs').item.json.slugs }}\n\nCheck all internal links carefully. Maintain a balance between internal and external links received in your input (minimum of 3 internal and 3 external) to guarantee educational continuity and article reliability, based on both internal and external sources. Never cite any of them in isolation or without context — they must appear only within meaningful sentences, never as standalone paragraphs for the final reader (whether a medical professional or layperson).\n\nBelow is the complete content of the post to be written, already including external link references:\n{{ $json.message.content }}\n\nReturn the post in HTML format, including title, body, and slug to be used on my blog."
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"id": "Tf4ac3A66loxAGyo",
"name": "OpenAi account"
}
},
"typeVersion": 1.6
},
{
"id": "ee68bb1b-22a1-4a78-8afd-e72961f078d3",
"name": "发送到Wordpress",
"type": "n8n-nodes-base.wordpress",
"position": [
1616,
752
],
"parameters": {
"title": "={{ $json.message.content.title }}",
"additionalFields": {
"slug": "={{ $json.message.content.slug }}",
"status": "publish",
"content": "={{ $json.message.content.content }}"
}
},
"credentials": {
"wordpressApi": {
"id": "m0QzeTPR7r2IgjIz",
"name": "Wordpress account"
}
},
"typeVersion": 1,
"alwaysOutputData": false
},
{
"id": "33b4a5ea-7e3a-4b34-a767-a20f84a94b10",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
304,
304
],
"parameters": {
"color": 4,
"width": 400,
"height": 576,
"content": "## 开始"
},
"typeVersion": 1
},
{
"id": "cd19392e-3219-4361-a493-dcc61b041198",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1856,
320
],
"parameters": {
"color": 5,
"width": 256,
"height": 192,
"content": "## ⬅️ 计划自动文章生成器"
},
"typeVersion": 1
},
{
"id": "46cc2f32-8a48-4077-b28f-889c5b7edfd3",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1856,
544
],
"parameters": {
"color": 5,
"width": 256,
"height": 96,
"content": "## ⬅️ 基于聊天的自动文章生成器"
},
"typeVersion": 1
},
{
"id": "9cb3c530-a205-4053-8ddc-46e4fad683c2",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1856,
672
],
"parameters": {
"color": 3,
"width": 256,
"height": 224,
"content": "## 重要!"
},
"typeVersion": 1
},
{
"id": "993d972f-9dab-4fa9-a010-9674ca49a3cd",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
960,
144
],
"parameters": {
"width": 464,
"height": 144,
"content": "## 站点地图"
},
"typeVersion": 1
},
{
"id": "93697b6c-29e3-49dc-a5f4-b95f9d12a127",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
304,
80
],
"parameters": {
"color": 6,
"width": 400,
"height": 208,
"content": "### 关于此工作流"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d30cfd85-835d-4a13-8f46-d87581b4f1d3",
"connections": {
"Create Post": {
"main": [
[
{
"node": "Review Post",
"type": "main",
"index": 0
}
]
]
},
"Review Post": {
"main": [
[
{
"node": "Send to Wordpress",
"type": "main",
"index": 0
}
]
]
},
"Chat Message": {
"main": [
[
{
"node": "[CHAT] Get Sitemap",
"type": "main",
"index": 0
}
]
]
},
"Choose Right One": {
"main": [
[
{
"node": "Create Post",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "[SCHEDULE] Get Sitemap",
"type": "main",
"index": 0
}
]
]
},
"Send to Wordpress": {
"main": [
[]
]
},
"[CHAT] Get Sitemap": {
"main": [
[
{
"node": "[CHAT] Sitemap to Json",
"type": "main",
"index": 0
}
]
]
},
"[CHAT] Order Slugs": {
"main": [
[
{
"node": "Choose Right One",
"type": "main",
"index": 0
}
]
]
},
"[CHAT] Sitemap to Json": {
"main": [
[
{
"node": "[CHAT] Order Slugs",
"type": "main",
"index": 0
}
]
]
},
"[SCHEDULE] Get Sitemap": {
"main": [
[
{
"node": "[SCHEDULE] Sitemap to Json",
"type": "main",
"index": 0
}
]
]
},
"[SCHEDULE] Order Slugs": {
"main": [
[
{
"node": "[SCHEDULE] New Blog Post Theme",
"type": "main",
"index": 0
}
]
]
},
"[SCHEDULE] Sitemap to Json": {
"main": [
[
{
"node": "[SCHEDULE] Order Slugs",
"type": "main",
"index": 0
}
]
]
},
"[SCHEDULE] New Blog Post Theme": {
"main": [
[
{
"node": "Choose Right One",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用GPT-5和fal.ai图像从关键词到WordPress自动化SEO博客流程
使用GPT-5和fal.ai图像从关键词到WordPress自动化SEO博客流程
Set
Code
Wait
+20
96 节点Paul
内容创作
使用OpenAI和WordPress自动化SEO博客文章创建与发布
使用OpenAI和WordPress自动化SEO博客文章创建与发布
If
Set
Code
+11
22 节点Khaisa Studio
内容创作
WordPress博客自动化专业版(深度研究)v2.1市场
使用GPT-4o、Perplexity AI和多语言支持自动化SEO优化的博客创建
If
Set
Xml
+27
125 节点Daniel Ng
内容创作
使用OpenAI自动化WordPress和WooCommerce内容:评论、留言和更新
使用OpenAI自动化WordPress和WooCommerce内容:评论、留言和更新
Set
Code
Wordpress
+5
38 节点Ali Khosravani
内容创作
基于 YouTube 视频的自主博客发布
使用 ChatGPT、Sheets、Apify、Pexels 和 WordPress 从 YouTube 视频自主发布博客
If
Set
Code
+18
80 节点Oriol Seguí
内容创作
使用Perplexity和GPT为WordPress创建SEO优化博客,包含关键词和媒体
使用Perplexity和GPT为WordPress创建SEO优化博客,包含关键词和媒体
Set
Code
Limit
+22
124 节点Paul
内容创作