Google SheetsからWordPressへのアクセシブル代替テキスト生成(Claude AI)

中級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、10個のノードを含みます。主にIf, Code, HttpRequest, GoogleSheets, SplitInBatchesなどのノードを使用。 Claude AIでGoogle SheetsからWordPressへアクセシブルな代替テキストを生成

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "393ca9e36a1f81b0f643c72792946a5fe5e49eb4864181ba4032e5a408278263",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b093bb6e-2797-470b-b32f-c4ffe96249bb",
      "name": "アイテムをループ処理",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        912,
        -16
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "30695fd4-d335-46c8-9987-119ce068da74",
      "name": "画像を分析",
      "type": "@n8n/n8n-nodes-langchain.anthropic",
      "onError": "continueRegularOutput",
      "position": [
        1152,
        0
      ],
      "parameters": {
        "text": "#Tâche \nAnalysez cette image et rédigez une description alternative (alt text) pour l'accessibilité web.\nCritères :\n\n##Caractéristiques\nMaximum 125 caractères\nDécrire les éléments visuels essentiels\nTon neutre et factuel\nCommencer par l'élément principal\n\nInclure : sujet principal, actions significatives, contexte important, texte visible\nÉviter : \"image de\", \"photo de\", détails décoratifs, interprétations\nRéponse : Fournir uniquement la description, sans guillemets.\n\n##Exemples\n\nIncorrect : Photo d'un chat mignon qui dort sur un canapé rouge dans un salon\nCorrect : Chat tigré dormant sur un canapé rouge",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "claude-sonnet-4-20250514"
        },
        "options": {},
        "resource": "image",
        "imageUrls": "={{ $json.URL }}"
      },
      "credentials": {
        "anthropicApi": {
          "id": "WXQf5QsxCs3AyxlW",
          "name": "Anthropic account"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "e981bf45-2b8b-45ae-bce5-f20f6d29941b",
      "name": "シートの行を更新",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1568,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "URL": "={{ $('Loop Over Items').item.json.URL }}",
            "Alt text": "={{ $json.content[0].text }}",
            "row_number": 0
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Alt text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Alt text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Export media"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Send Sheets URL').item.json.chatInput }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wBRLUCktxqXE6DVJ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "71cf07ec-7559-4944-a0e6-adf9b85ac4ee",
      "name": "Sheets URLを送信",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        16,
        0
      ],
      "webhookId": "cb9f34cd-dd44-4859-8a12-4f7a20c32237",
      "parameters": {
        "mode": "webhook",
        "public": true,
        "options": {
          "responseMode": "responseNode"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "1060d6dd-e8c7-4550-bac0-ab2e608b75a1",
      "name": "URLを取得",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        656,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Export media"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Send Sheets URL').item.json.chatInput }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wBRLUCktxqXE6DVJ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1c82e061-01e3-4efb-861f-b928903ec7ee",
      "name": "WPキー+ウェブサイトURLを取得(https://なし)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Infos client"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $json.chatInput }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wBRLUCktxqXE6DVJ",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "232776ed-2123-4ff7-96f5-336e85470a99",
      "name": "Base64キーを取得",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        0
      ],
      "parameters": {
        "jsCode": "// Dans une Function/Code node n8n\nconst username = $('Get WP Key + website URL WITHOUT https://').first().json['Admin Name'];\nconst password = $('Get WP Key + website URL WITHOUT https://').first().json.KEY;\nconst credentials = username + ':' + password;\n\n// Encoder en Base64 avec Buffer (Node.js)\nconst encodedCredentials = Buffer.from(credentials).toString('base64');\nconst authHeader = 'Basic ' + encodedCredentials;\n\nreturn {\n  json: {\n    username: username,\n    password: password,\n    credentials: credentials,\n    authHeader: authHeader\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "5ef87414-1e64-443d-925d-fd4c443030d3",
      "name": "WP画像のaltを更新",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        0
      ],
      "parameters": {
        "url": "=https://{{ $('Get WP Key + website URL WITHOUT https://').item.json.Domaine }}/wp-json/wp/v2/media/{{ $('Loop Over Items').item.json.ID }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "alt_text",
              "value": "={{ $('Analyze image').item.json.content[0].text }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Authorization",
              "value": "={{ $('Get Base64 key').item.json.authHeader }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3fb66fec-319f-482c-8b04-3a45490bea72",
      "name": "条件分岐",
      "type": "n8n-nodes-base.if",
      "position": [
        1360,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "86ad2ab9-a213-4e16-b81b-b1c4315b6822",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7d00b936-879e-45d0-a874-2a40f5b5f6c3",
      "name": "付箋メモ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -592
      ],
      "parameters": {
        "color": 4,
        "width": 816,
        "height": 1776,
        "content": "Voici la description avec le lien hypertexte échappé :\n## AI-powered alt text generation from Google Sheets to WordPress media\n## Who's it for\nWordPress site owners, content managers, and accessibility advocates who need to efficiently add alt text descriptions to multiple images for better SEO and web accessibility compliance.\n## What it does\nThis workflow automates the process of generating and updating alt text for WordPress media files using AI analysis. It reads image URLs from a Google Sheet, analyzes each image with Claude AI to generate accessibility-compliant descriptions, updates the sheet with the generated alt text, and automatically applies the descriptions to the corresponding WordPress media files. The workflow includes error handling to skip unsupported media formats and continue processing.\n## How it works\n\nInput: Provide a Google Sheets URL containing image URLs and WordPress media IDs\nAuthentication: Retrieves WordPress credentials from a separate sheet and generates Base64 authentication\nProcessing: Loops through each image URL in the sheet\nAI Analysis: Claude AI analyzes each image and generates concise, accessible alt text (max 125 characters)\nError Handling: Automatically skips unsupported media formats and continues with the next item\nUpdate Sheet: Writes the generated alt text back to the Google Sheet\nWordPress Update: Updates the WordPress media library with the new alt text via REST API\n\n## Requirements\n\nGoogle Sheets with image URLs and WordPress media IDs\nWordPress site with Application Passwords enabled\nClaude AI (Anthropic) API credentials\nWordPress admin credentials stored in Google Sheets\nExport Media URLs WordPress plugin for generating the media list\n\n## How to set up\n### Step 1: Export your WordPress media URLs\n\nInstall the \"Export Media URLs\" plugin on your WordPress site\nGo to the plugin settings and check both ID and URL columns for export (these are mandatory for the workflow)\nExport your media list to get the required data\n\n### Step 2: Configure WordPress Application Passwords\n\nGo to WordPress Admin → Users → Your Profile\nScroll down to \"Application Passwords\" section\nEnter application name (e.g., \"n8n API\")\nClick \"Add New Application Password\"\nCopy the generated password immediately (it won't be shown again)\n\n### Step 3: Set up Google Sheets\n[Duplicate this Google Sheets template]\n(https://docs.google.com/spreadsheets/d/1BKGQRx_xDiuh3QD3ACOOTJomsWFuPBjCHYMQX8UzTBE/edit?usp=sharing\\) to get the correct structure.\nThe template includes two sheets:\nSheet 1: \"Export media\" - Paste your exported media data with columns:\n\nID (WordPress media ID)\nURL (image URL)\nAlt text (will be populated by the workflow)\n\nSheet 2: \"Infos client\" - Add your WordPress credentials:\n\nAdmin Name: Your WordPress username\nKEY: The application password you generated\nDomaine: Your site URL without https:// (format: \"example.com\")\n\n### Step 4: Configure API credentials\n\nAdd your Anthropic API credentials to the Claude node\nConnect your Google Sheets account to the Google Sheets nodes\n\n## How to customize\n\nLanguage: The Claude prompt is in French - modify it in the \"Analyze image\" node for other languages\nAlt text length: Adjust the 125-character limit in the Claude prompt\nBatch processing: Change the batch size in the Split in Batches node\nError handling: The workflow automatically handles unsupported formats, but you can modify the error handling logic\nAuthentication: Customize for different WordPress authentication methods\n\nThis workflow is perfect for managing accessibility compliance across large WordPress media libraries while maintaining consistent, AI-generated descriptions. It's built to be resilient and will continue processing even when encountering unsupported media formats."
      },
      "typeVersion": 1
    },
    {
      "id": "ccae276a-6fc9-4a8e-94d4-f72a478cf336",
      "name": "完了",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1168,
        -192
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={\n    \"text\": \"Fin de la rédaction des alt description\"\n } "
      },
      "typeVersion": 1.2
    }
  ],
  "pinData": {},
  "connections": {
    "3fb66fec-319f-482c-8b04-3a45490bea72": {
      "main": [
        [
          {
            "node": "e981bf45-2b8b-45ae-bce5-f20f6d29941b",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "b093bb6e-2797-470b-b32f-c4ffe96249bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1060d6dd-e8c7-4550-bac0-ab2e608b75a1": {
      "main": [
        [
          {
            "node": "b093bb6e-2797-470b-b32f-c4ffe96249bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "30695fd4-d335-46c8-9987-119ce068da74": {
      "main": [
        [
          {
            "node": "3fb66fec-319f-482c-8b04-3a45490bea72",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "232776ed-2123-4ff7-96f5-336e85470a99": {
      "main": [
        [
          {
            "node": "1060d6dd-e8c7-4550-bac0-ab2e608b75a1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b093bb6e-2797-470b-b32f-c4ffe96249bb": {
      "main": [
        [
          {
            "node": "ccae276a-6fc9-4a8e-94d4-f72a478cf336",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "30695fd4-d335-46c8-9987-119ce068da74",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "71cf07ec-7559-4944-a0e6-adf9b85ac4ee": {
      "main": [
        [
          {
            "node": "1c82e061-01e3-4efb-861f-b928903ec7ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5ef87414-1e64-443d-925d-fd4c443030d3": {
      "main": [
        [
          {
            "node": "b093bb6e-2797-470b-b32f-c4ffe96249bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e981bf45-2b8b-45ae-bce5-f20f6d29941b": {
      "main": [
        [
          {
            "node": "5ef87414-1e64-443d-925d-fd4c443030d3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1c82e061-01e3-4efb-861f-b928903ec7ee": {
      "main": [
        [
          {
            "node": "232776ed-2123-4ff7-96f5-336e85470a99",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - コンテンツ作成, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

ワークフロー情報
難易度
中級
ノード数10
カテゴリー2
ノードタイプ8
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34