AutomationFlowsAI & RAG › Automated Wordpress Post Tagging with AI Analysis and Claude Opus 4.5

Automated Wordpress Post Tagging with AI Analysis and Claude Opus 4.5

ByDavide Boizza @n3witalia on n8n.io

This workflow automates the full process of generating, creating, and assigning optimized WordPress tags to a specific blog post. It uses a combination of WordPress API actions, AI analysis (Claude Opus 4.5), and internal data cleaning to ensure SEO-friendly, consistent, and…

Event trigger★★★★☆ complexityAI-powered26 nodesOutput Parser StructuredOpenAI ChatChain LlmWordPressHTTP RequestAnthropic Chat
AI & RAG Trigger: Event Nodes: 26 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #11226 — we link there as the canonical source.

This workflow follows the Chainllm → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "RLbIL2g5eGLJgRif",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated WordPress Post Tagging with AI Analysis",
  "tags": [],
  "nodes": [
    {
      "id": "19d56691-de9b-4df2-9921-9a3612d9e4d5",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -944,
        -48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a343644f-f466-4250-a956-e2182eb510d5",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        688,
        256
      ],
      "parameters": {
        "autoFix": true,
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"required\": [\"tags\", \"new_tag\"],\n  \"properties\": {\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"number\"\n      }\n    },\n    \"new_tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "dd612a8c-8ca6-41ea-a3a6-1f18f3963b19",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        608,
        448
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b2f9a916-b4eb-45d7-a957-7472875e530e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        224,
        -32
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "ec85a859-1959-45a1-ba8a-10f8ad2ef335",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1952,
        352
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "0e77a564-4e3e-4fca-b5c8-d659c258701d",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1696,
        352
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "new_tags"
      },
      "typeVersion": 1
    },
    {
      "id": "91860e9c-f950-415f-a4eb-a3d4baede93f",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2496,
        -64
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "d35b31af-8c7b-4ff3-82a3-b47d4539da1b",
      "name": "Tags Expert",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        592,
        -32
      ],
      "parameters": {
        "text": "=Create meta-title, meta-description, tags, new tags in the language of the following article.\n\n# Title\n{{ $json.title.rendered }}\n\n# Content\n{{ $json.content.rendered }}\n\n# Excerpt\n{{ $json.excerpt.rendered }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are an expert SEO content optimizer specialized in creating tags for blog articles. Your task is to analyze the provided content and generate or associate optimized tags based on the content type.\n\nANALYSIS PROCESS:\n\n1. Content Assessment:\n   - Identify content type and purpose\n   - Extract main topic and keywords\n   - Determine search intent\n   - Identify target audience\n   - Note key differentiators\n\n2. Optimization Strategy:\n   - Align with search intent\n   - Consider competition level\n   - Factor in brand guidelines\n   - Account for content freshness\n   - Optimize for click-through rate\n\n3. Tag Management:\n   - Compare provided JSON tag list with content {{ JSON.stringify($json.tags) }}\n   - Select maximum 4 most relevant existing tags (return only tag_id)\n   - If fewer than 4 tags match, create new WordPress tags to reach 4 total\n   - New tags should be multi-word phrases or single words that:\n     * Are typically used together\n     * Are specific acronyms/abbreviations \n     * Represent unique concepts not commonly found in other contexts\n   - Return empty array if no existing tags are applicable\n\nOUTPUT FORMAT:\n\nPlease provide the following in JSON format:\n```json\n{\n  \"tags\": [array of selected tag IDs, max 4],\n  \"new_tags\": [array of new tag strings to create, if needed to reach 4 total]\n}\n```\n\nVALIDATION CHECKLIST:\n\n- Total tags (existing + new) = 4 or less\n- Existing tag IDs accurately match provided list\n- New tags follow naming conventions (multi-word phrases or specific acronyms)\n\nRemember: The goal is to create tags that serve both search engines and users effectively while maintaining specificity for the content type and maximizing organic click-through rates."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "acf6d3a2-fff4-44ad-a4b0-464fd60513e8",
      "name": "Get article",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        -464,
        -48
      ],
      "parameters": {
        "postId": "={{ $json.post_id }}",
        "options": {},
        "operation": "get"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c435cf92-29c5-4846-bef3-439f959268fe",
      "name": "Set data",
      "type": "n8n-nodes-base.set",
      "position": [
        -688,
        -48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a10ed696-c29f-47e1-830a-d13eb40ee400",
              "name": "post_id",
              "type": "string",
              "value": "XX"
            },
            {
              "id": "3111b800-7273-483c-b689-47a3ce37423f",
              "name": "url",
              "type": "string",
              "value": "https://XXX"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "35b8af4b-17d4-432e-9dad-dec6477d7f39",
      "name": "Get all tags",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -208,
        112
      ],
      "parameters": {
        "url": "={{ $('Set data').item.json.url }}wp-json/wp/v2/tags",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a332004c-b183-418f-bcd5-7e8ecbca0ac3",
      "name": "Sanitaze Tags",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        16,
        112
      ],
      "parameters": {
        "include": "specifiedFields",
        "options": {},
        "aggregate": "aggregateAllItemData",
        "fieldsToInclude": "id,name",
        "destinationFieldName": "tags"
      },
      "typeVersion": 1
    },
    {
      "id": "75fd4341-4739-4097-8962-18ef97afa8c0",
      "name": "Update article",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        3216,
        -64
      ],
      "parameters": {
        "postId": "={{ $('Set data').item.json.post_id }}",
        "operation": "update",
        "updateFields": {
          "tags": "={{ $json.tags }}"
        }
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "74218def-028a-4897-bc90-7f96be1abe39",
      "name": "Existing Tags",
      "type": "n8n-nodes-base.set",
      "position": [
        1456,
        -80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b8ee7381-09fb-4667-ba90-553ee41d1cd5",
              "name": "tags",
              "type": "array",
              "value": "={{ $json.output.tags }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "aa018103-57fc-4876-ac50-cef5e486a976",
      "name": "New Tags",
      "type": "n8n-nodes-base.set",
      "position": [
        1440,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b8ee7381-09fb-4667-ba90-553ee41d1cd5",
              "name": "new_tags",
              "type": "array",
              "value": "={{ $json.output.new_tags }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "932d4bc8-c787-466c-b622-713e3ec3d6e8",
      "name": "Add tag",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2240,
        416
      ],
      "parameters": {
        "url": "={{ $('Set data').item.json.url }}wp-json/wp/v2/tags",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $json.new_tags }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "90ce0a46-2b4c-4588-b7a1-a862a24c579c",
      "name": "Aggretate new tags",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2240,
        256
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "tags",
              "fieldToAggregate": "id"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c5b7b08f-7a03-4f0f-bd0c-fff925f91af1",
      "name": "Aggregate tags article",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2752,
        -64
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "tags"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1862f83f-9e7b-4f3b-8543-b221e2013ed2",
      "name": "Sanitize",
      "type": "n8n-nodes-base.code",
      "position": [
        2976,
        -64
      ],
      "parameters": {
        "jsCode": "// Ottieni l'input dal nodo precedente\nconst inputData = $input.all();\n\n// Array per raccogliere tutti i tag IDs\nlet allTagIds = [];\n\n// Itera attraverso tutti gli item in input\nfor (const item of inputData) {\n  const tags = item.json.tags;\n  \n  // Se tags esiste ed \u00e8 un array\n  if (Array.isArray(tags)) {\n    // Itera attraverso ogni array dentro tags\n    for (const tagArray of tags) {\n      // Se \u00e8 un array, aggiungi tutti gli ID\n      if (Array.isArray(tagArray)) {\n        allTagIds = allTagIds.concat(tagArray);\n      }\n    }\n  }\n}\n\n// Rimuovi eventuali duplicati (opzionale)\nallTagIds = [...new Set(allTagIds)];\n\n// Restituisci il risultato come oggetto con l'array dentro\nreturn [{ json: { tags: allTagIds } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "987a4979-df07-4c6e-8048-8f99cf907d6c",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        528,
        256
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-opus-4-5-20251101",
          "cachedResultName": "Claude Opus 4.5"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "84fe9ff4-9b56-4cd8-9001-017e1eca187c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -704
      ],
      "parameters": {
        "width": 1104,
        "height": 448,
        "content": "## Automated WordPress Post Tagging with AI Analysis\n\nThis workflow automates the full process of **generating, creating, and assigning optimized WordPress tags** to a specific blog post. It uses a combination of WordPress API actions, AI analysis (OpenAI), and internal data cleaning to ensure SEO-friendly, consistent, and properly structured tags\n\n### **How it works:**\n\nThis workflow automates the process of analyzing a WordPress blog post and assigning SEO-optimized tags using AI. It retrieves the target post and existing tags, merges this data, and sends it to an AI model (Claude Opus 4.5) that selects or generates up to four relevant tags. Existing tags are prepared for update, while new tags are created automatically through the WordPress API. The final list of tag IDs\u2014both new and existing\u2014is then assigned back to the original post, ensuring a clean, optimized, and consistent tagging structure.\n\n### **Setup steps:**\n\nSet the required input fields in the \u201cSet data\u201d node: `post_id` (the target post\u2019s ID) and `url` (your WordPress base URL). Connect the \u201cWordPress\u201d and \u201cHTTP Request\u201d nodes with valid WordPress credentials that allow post and tag management. Add a valid Claude Opus 4.5 API key to the AI nodes. Once all credentials are configured, execute the workflow manually to fetch the post, analyze it with AI, generate or create tags as needed, and update the article with the final optimized tag set.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "82abca87-cea3-445e-a5c9-93453b14ee1e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 1104,
        "height": 800,
        "content": "## STEP 1 - Get all tags from website\n\nFetching a specific WordPress article using a provided post_id. Simultaneously, it retrieves all existing tags from the WordPress site via the REST API. These two data streams are then merged into a single data structure."
      },
      "typeVersion": 1
    },
    {
      "id": "3cafca79-2274-4ff8-a0f2-f1cffb7febc5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 688,
        "height": 800,
        "content": "## STEP 2 - Tag Analysis\nThe merged data (article content and existing tag list) is sent to an LLM (Claude 4.5 Opus). The AI acts as an \"SEO expert,\" analyzing the article's title, content, and excerpt. It follows a strict set of instructions to select up to 4 relevant tags from the existing list and, if needed, suggests new tag names to reach a total of 4 tags."
      },
      "typeVersion": 1
    },
    {
      "id": "3cdde487-bef4-48a4-bf43-03cc7873899d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 1296,
        "height": 304,
        "content": "## STEP 3 - Existing Tags\nThe list of selected tag IDs is prepared for the final update. "
      },
      "typeVersion": 1
    },
    {
      "id": "9bb3fd91-3eba-477c-ac4d-6668b79edb37",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 1312,
        "height": 464,
        "content": "## STEP 4 - New Tags\nThe list of new tag names is processed in a loop. For each new tag, the workflow sends a POST request to the WordPress API to create it. The newly created tag IDs are collected."
      },
      "typeVersion": 1
    },
    {
      "id": "45d2e8be-4259-4ff4-986f-bea01735df3c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2656,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 768,
        "height": 304,
        "content": "## STEP 5 - Final Assignment:\nThe existing tag IDs and the newly created tag IDs are merged into a single list. This final list of tag IDs is then sent back to the original WordPress article via an \"Update\" operation, effectively tagging the post."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4c4d3984-8c02-431c-b772-61a95dc2c456",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Tags Expert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Aggregate tags article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add tag": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Tags": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sanitize": {
      "main": [
        [
          {
            "node": "Update article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set data": {
      "main": [
        [
          {
            "node": "Get article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get article": {
      "main": [
        [
          {
            "node": "Get all tags",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tags Expert": {
      "main": [
        [
          {
            "node": "Existing Tags",
            "type": "main",
            "index": 0
          },
          {
            "node": "New Tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all tags": {
      "main": [
        [
          {
            "node": "Sanitaze Tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Existing Tags": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sanitaze Tags": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Aggretate new tags",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add tag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggretate new tags": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Tags Expert",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate tags article": {
      "main": [
        [
          {
            "node": "Sanitize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Tags Expert",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Set data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates the full process of generating, creating, and assigning optimized WordPress tags to a specific blog post. It uses a combination of WordPress API actions, AI analysis (Claude Opus 4.5), and internal data cleaning to ensure SEO-friendly, consistent, and…

Source: https://n8n.io/workflows/11226/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

The best content automation template in the market is now even better—with “deep research” on time-sensitive topics\! Unlike most n8n content automation templates that are mainly for “demo purposes,”

OpenAI, HTTP Request, XML +11
AI & RAG

My workflow 53. Uses formTrigger, httpRequest, lmChatOpenAi, form. Event-driven trigger; 74 nodes.

Form Trigger, HTTP Request, OpenAI Chat +15
AI & RAG

Episode 23: UGC with nanobanana. Uses lmChatOpenAi, lmChatOllama, lmChatDeepSeek, lmChatOpenRouter. Event-driven trigger; 74 nodes.

OpenAI Chat, Ollama Chat, Lm Chat Deep Seek +12
AI & RAG

Ultimate Blogblizt is a powerhouse workflow that solves the tedious task of crafting and publishing SEO-optimized tech blog posts. It integrates AI models (OpenAI, Google Gemini), WordPress, and multi

Chain Llm, Telegram Trigger, OpenAI Chat +10
AI & RAG

Content - Write Best Tools In Category Article. Uses formTrigger, httpRequest, slack, chainLlm. Event-driven trigger; 41 nodes.

Form Trigger, HTTP Request, Slack +6