I’m trying to post a blog post to my WordPress website using an n8n workflow. So far, I’m making good progress, but one of the last steps isn’t working: connecting to WordPress.
I’ve already taken the necessary steps, such as clearing the cache and creating an application password with the correct permissions.
After entering my information, I keep getting the message that the password is incorrect. I’ve also tried using Postman and Terminal on my Mac, but they still display the error.
After much puzzling, I’ve finally come to the conclusion that I can’t figure it out.
Perhaps needless to say, but my login name and password are correct.
What is the error message (if any)?
Problem in node ‘HTTP Request‘
Authorization failed - please check your credentials
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“field”: “cronExpression”,
“expression”: “0 10 * * 2,4,6”
}
]
}
},
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
-380,
0
],
“id”: “fa8d021e-165a-4aa0-bf9b-ca81229e84c2”,
“name”: “Schedule Trigger”
},
{
“parameters”: {
“jsCode”: “return [\n {\n json: {\n prompt:\n ‘Geef 5 actuele Nederlandse blogonderwerpen voor vrouwen 30-55 jaar over uitgroei, haar verven of thuis kleuren. Lever als geldige JSON-array.’\n }\n }\n];\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
-240,
-120
],
“id”: “f9a31b23-c4ae-4aaa-8724-4886cbe85d8f”,
“name”: “Code”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-240,
-300
],
“id”: “3504a38f-b08c-46f2-ba3c-0d988da8cff8”,
“name”: “When chat message received”,
“webhookId”: “11023c49-df9b-410b-b776-f5075408607e”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-4o”,
“mode”: “list”,
“cachedResultName”: “gpt-4o”
},
“options”: {
“temperature”: 0.8
}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
-20,
-300
],
“id”: “680437f5-c1c0-4b52-8eee-523ed8a1dfd4”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “VONEiaex3erD4URe”,
“name”: “OpenAi account 2”
}
}
},
{
“parameters”: {
“url”: “https://uitgroeikleur.nl/wp-json/wp/v2/posts?per_page=100”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBasicAuth”,
“options”: {
“response”: {
“response”: {
“responseFormat”: “json”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
520,
-180
],
“id”: “d8a8e58c-77c8-47dc-a32c-68e52adff7be”,
“name”: “HTTP Request”,
“credentials”: {
“httpBasicAuth”: {
“id”: “JNn7mqgKcB6V7M1o”,
“name”: “Unnamed credential 2”
}
}
},
{
“parameters”: {
“jsCode”: “// Stream 0 = WP-posts, Stream 1 = GPT-onderwerpen\nconst wpPosts = $input.all(0);\nconst suggestions = $input.all(1);\n\n//
Eerste sanity-checks\nif (!wpPosts.length || !suggestions.length) {\n throw new Error(‘Ontbrekende input-streams’);\n}\n\n// WP-titels lowercased\nconst existing = wpPosts.map(p =>\n (p.json.title?.rendered || ‘’).toLowerCase()\n);\n\n// Subjects as plain strings\nconst suggTitles = suggestions\n .map(s => s.json.title) // pas ‘title’ aan als key anders is\n .filter(t => typeof t === ‘string’ && t.length);\n\n// eerste unieke zoeken\nconst nieuw = suggTitles.find(t =>\n !existing.includes(t.toLowerCase())\n);\n\n// Output of stoppen\nreturn nieuw ? [{ json: { topic: nieuw } }] : ;\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
400,
60
],
“id”: “f03f80ea-3644-41b9-854a-ddcc1127e570”,
“name”: “Code1”,
“alwaysOutputData”: true
},
{
“parameters”: {
“jsCode”: “// De Basic LLM Chain geeft één item door met text\nconst raw = items[0].json.text || ‘’; // pas ‘text’ aan als jouw key anders heet\n\n// strip eventuele markdown/backticks\nconst cleaned = raw.replace(/json|/g, ‘’).trim();\n\nlet arr = ;\ntry {\n arr = JSON.parse(cleaned);\n} catch (e) {\n // fallback: probeer simpele split\n arr = cleaned\n .split(‘\n’)\n .map(t => t.replace(/(^"|"$)/g, ‘’).trim())\n .filter(Boolean);\n}\n\n// Maak van elk onderwerp een apart item\nreturn arr.map(t => ({ json: { title: t } }));\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
300,
-180
],
“id”: “b83311c3-7f05-4ca2-9c63-ee30ac0ae2bd”,
“name”: “Code2”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-4o”,
“mode”: “list”,
“cachedResultName”: “gpt-4o”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
620,
220
],
“id”: “d728dbba-6b77-4572-a6e5-9d1345122401”,
“name”: “OpenAI Chat Model1”,
“credentials”: {
“openAiApi”: {
“id”: “VONEiaex3erD4URe”,
“name”: “OpenAi account 2”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: " ",
“hasOutputParser”: true,
“messages”: {
“messageValues”: [
{
“message”: “Je bent een Nederlandse copywriter voor uitgroeikleur.nl. Lever altijd een geldige JSON-structuur.”
},
{
“type”: “HumanMessagePromptTemplate”,
“message”: “=Schrijf een blog van 800-900 woorden in toegankelijke, vriendelijke maar professionele stijl over: \"${$node[\"Code1\"].json.topic}\". Beantwoord **uitsluitend** met geldige JSON **en niets anders**:\n{\n \"title\": \"\",\n \"slug\": \"\",\n \"excerpt\": \"\",\n \"content_md\": \"\",\n \"image_prompt\": \"\"\n}”
}
]
},
“batching”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chainLlm”,
“typeVersion”: 1.7,
“position”: [
620,
60
],
“id”: “bdf70a0d-6fd9-49f3-8794-222f857ef84e”,
“name”: “Basic LLM Chain1”
},
{
“parameters”: {
“resource”: “image”,
“prompt”: “={{${JSON.parse($node[\"Basic LLM Chain1\"].json.text).image_prompt} — kleurrijke flat-illustratie, kleurstelling die past bij de website uitgroeikleur.nl, met speelse diepte en zachte schaduwen in een frisse pastelkleurenpalet}}\n”,
“options”: {
“dalleQuality”: “standard”,
“size”: “1024x1024”,
“style”: “natural”
}
},
“type”: “@n8n/n8n-nodes-langchain.openAi”,
“typeVersion”: 1.8,
“position”: [
960,
60
],
“id”: “cf7cb446-1600-4687-8c3a-a17b5f91917f”,
“name”: “Generate an image”,
“credentials”: {
“openAiApi”: {
“id”: “VONEiaex3erD4URe”,
“name”: “OpenAi account 2”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://uitgroeikleur.nl/wp-json/wp/v2/posts”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBasicAuth”,
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\n "title": "{{ $node[‘Basic LLM Chain1’].json.title }}",\n "content": "{{ $node[‘Basic LLM Chain1’].json.content_md }}
<img src=‘{{ $node[‘Generate an image’].json.data[0].url }}’ alt=‘blog afbeelding’ />",\n "excerpt": "{{ $node[‘Basic LLM Chain1’].json.excerpt }}",\n "slug": "{{ $node[‘Basic LLM Chain1’].json.slug }}",\n "status": "draft"\n}”,
“options”: {
“response”: {
“response”: {
“responseFormat”: “json”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
1140,
60
],
“id”: “15f44a84-8729-4d2f-b6b6-07a62cf63f61”,
“name”: “HTTP Request1”,
“alwaysOutputData”: false,
“credentials”: {
“httpBasicAuth”: {
“id”: “JNn7mqgKcB6V7M1o”,
“name”: “Unnamed credential 2”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://www.uitgroeikleur.nl/wp-json/wp/v2/media”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBasicAuth”,
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\n "title": "Afbeelding – {{$node[‘Basic LLM Chain1’].json.title}}",\n "source_url": "{{$node[‘Generate an image’].json.data[0].url}}"\n}\n”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
960,
320
],
“id”: “14de4641-dbd9-4883-a808-03a61eed6b17”,
“name”: “Upload to WP Media”,
“credentials”: {
“httpBasicAuth”: {
“id”: “JNn7mqgKcB6V7M1o”,
“name”: “Unnamed credential 2”
}
}
}
],
“connections”: {
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Code”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code”: {
“main”: [
]
},
“When chat message received”: {
“main”: [
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “Code1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code1”: {
“main”: [
[
{
“node”: “Basic LLM Chain1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code2”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
},
{
“node”: “Code1”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “Basic LLM Chain1”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Basic LLM Chain1”: {
“main”: [
[
{
“node”: “Generate an image”,
“type”: “main”,
“index”: 0
}
]
]
},
“Generate an image”: {
“main”: [
[
{
“node”: “HTTP Request1”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request1”: {
“main”: [
[
{
“node”: “Upload to WP Media”,
“type”: “main”,
“index”: 0
}
]
]
},
“Upload to WP Media”: {
“main”: [
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “7a769c443c3e77c5445acfc4af75661b12c3a3f512a6b7b30ac5296f54025d84”
}
}
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
