AutomationFlowsContent & Video › Generate Bilingual Wordpress Posts with Openai and Wpml

Generate Bilingual Wordpress Posts with Openai and Wpml

ByDavide Boizza @n3witalia on n8n.io

This workflow generates an SEO-friendly blog post in Italian and English with OpenAI, publishes both versions to WordPress via the REST API, links them as WPML translations through a custom endpoint, generates a featured image, uploads it to the WordPress media library, and…

Event trigger★★★★☆ complexityAI-powered20 nodesHTTP RequestOutput Parser StructuredOpenAI ChatChain LlmOpenAI
Content & Video Trigger: Event Nodes: 20 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #16045 — 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": "9JA0rHpdJUPAB6ni",
  "name": "Wordpress Blog Post Generator for WPML",
  "tags": [],
  "nodes": [
    {
      "id": "9da76018-f9c0-4a16-9fcc-29698a55e449",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -112
      ],
      "parameters": {
        "width": 512,
        "height": 560,
        "content": "## Wordpress Blog Post Generator for WPML\n\n### How it works\n\nThis workflow manually generates a multilingual WordPress blog post using an OpenAI-powered article generator. It creates posts in two languages, links them as translations through a custom WPML endpoint, generates a featured image, uploads it to WordPress, and assigns the image to both language versions.\n\n### Setup steps\n\n- Configure OpenAI credentials for the article-generation chain and featured-image node.\n- Replace all `https://YOUR_URL` placeholders with the target WordPress site URL.\n- Configure WordPress REST API authentication for the post, media upload, and featured image update HTTP Request nodes.\n- Ensure WPML is installed and that the custom `/wp-json/custom/v1/link...` endpoint exists and can link translated posts.\n- Adjust the prompt in the Set context node to define the article topic, languages, structure, and output fields expected by the structured parser.\n\n### Customization\n\nModify the Set context prompt and structured output schema to change article format, target languages, tone, categories, tags, or image prompt behavior."
      },
      "typeVersion": 1
    },
    {
      "id": "3e90800b-afd8-49b9-84dc-6b813d75389e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 560,
        "content": "## Start and prompt setup\n\nManual trigger and initial context setup for the blog generation prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "9469eafa-0d17-4be0-b7f9-0c9d410a37f4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 560,
        "content": "## Generate article content\n\nUses the OpenAI chat model with a structured output parser to produce the multilingual article data consumed by the WordPress post creation steps."
      },
      "typeVersion": 1
    },
    {
      "id": "aae4c811-11e2-466c-920a-288a95089967",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 816,
        "height": 560,
        "content": "## Create translated posts\n\nCreates the first and second WordPress posts, then links them together as translations through the WPML/custom translation endpoint."
      },
      "typeVersion": 1
    },
    {
      "id": "0785d490-3a45-427d-89f6-1f1d2da15858",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2432,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 560,
        "content": "## Generate and upload image\n\nGenerates a featured image with OpenAI and uploads the resulting media file to the WordPress media library."
      },
      "typeVersion": 1
    },
    {
      "id": "f9e6a94a-0853-4ab4-8368-92eaa9d5b3b4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3040,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 560,
        "content": "## Assign featured images\n\nUpdates both language-specific WordPress posts so they use the uploaded media item as their featured image."
      },
      "typeVersion": 1
    },
    {
      "id": "74a98398-a7c3-4a66-8561-e58a07304329",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        560,
        96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9dd04bd4-7168-48f0-907f-db7c0d1f0dfd",
      "name": "Set Prompt Context",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3e8d2523-66aa-46fe-adcc-39dc78b9161e",
              "name": "prompt",
              "type": "string",
              "value": "=YOUR_PROMPT"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8c636742-ae7c-4e4c-a429-329adc637f6b",
      "name": "Post Media to WP API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2832,
        96
      ],
      "parameters": {
        "url": "https://YOUR_URL/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Disposition",
              "value": "=attachment; filename=\"copertina-{{ $('Post in Language 1').item.json.id }}.jpg\""
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "107452ad-4f06-4603-9360-f1820ba1772c",
      "name": "Parse Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1440,
        288
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"title_it\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"text_it\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n      \"title_en\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n      \"text_en\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "9803cc7b-0e22-4476-bd2a-ec96e8bf23b0",
      "name": "OpenAI GPT-5 Mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1136,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "options": {},
        "builtInTools": {
          "webSearch": {
            "searchContextSize": "medium"
          }
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "e8386dd0-f849-46c0-980f-7e5d69ea50a1",
      "name": "Post in Language 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1680,
        96
      ],
      "parameters": {
        "url": "https://YOUR_URL/wp-json/wp/v2/posts",
        "body": "={{ JSON.stringify({ title: $json.output.title_it, content: $json.output.text_it, status: \"publish\", lang: \"it\" }) }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "raw",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "rawContentType": "application/json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "60ea7c78-d5d5-41c3-a0e7-b8dd63ca0459",
      "name": "Link Translation Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2256,
        96
      ],
      "parameters": {
        "url": "=https://YOUR_URL/wp-json/custom/v1/link-translation",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"post_it\": {{ $('Post in Language 1').item.json.id }},\n  \"post_en\": {{ $json.id }}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "45baf4d1-7f8d-448e-b1b0-c80dc4d243c2",
      "name": "Update Post Image Lang 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3216,
        96
      ],
      "parameters": {
        "url": "=https://YOUR_URL/wp-json/wp/v2/posts/{{ $('Post in Language 1').item.json.id }}",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "featured_media",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f3fc1248-4a51-439c-94ad-1984000645a1",
      "name": "Update Post Image Lang 2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3232,
        272
      ],
      "parameters": {
        "url": "=https://YOUR_URL/wp-json/wp/v2/posts/{{ $('Post in Language 2').item.json.id }}",
        "method": "POST",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "featured_media",
              "value": "={{ $json.id }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1e5e6a71-ee25-4826-bc42-12a349d382a5",
      "name": "Post in Language 2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2000,
        96
      ],
      "parameters": {
        "url": "https://YOUR_URL/wp-json/wp/v2/posts",
        "body": "={{ JSON.stringify({ title: $('Generate Article Text').item.json.output.title_en, content: $('Generate Article Text').item.json.output.text_en, status: \"publish\", lang: \"en\", translation_of1: $json.id  }) }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "raw",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "rawContentType": "application/json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "21701369-afff-4730-b496-6c8ad65a02e3",
      "name": "Generate Article Text",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1200,
        96
      ],
      "parameters": {
        "text": "={{ $json.prompt }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=an SEO-friendly article on these topics: {{ $json.prompt }}  Instructions: - In the introduction, introduce the topic that will be covered in more detail in the rest of the text - The introduction should be about 60 words - The conclusion should be about 60 words - Use the conclusion to summarize everything said in the article and offer a conclusion to the reader - Write a maximum of 2-3 chapters. - Chapters should follow a logical flow and not repeat the same ideas. - Chapters should be related to each other and not isolated blocks of text. The text should flow and follow a linear logic. - Do not start chapters with \"Chapter 1\", \"Chapter 2\", \"Chapter 3\" ... write only the chapter title - For the text, use HTML for formatting, but limit yourself to bold, italics, paragraphs and lists. - Do not put the output between ```html but only the text - Do not use markdown for formatting. - Go deeper into the topic you are talking about, don't just throw superficial information out there - I only want HTML format in output\n\nWrite the article and title in italian and english"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "40e88517-3a88-4acd-9413-bc83077c1aa5",
      "name": "Create Featured Image with AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2592,
        96
      ],
      "parameters": {
        "model": "gpt-image-1",
        "prompt": "=Generate a real photo image used as a blog post cover (without writing):\n\nImage prompt:\n{{ $('Generate Article Text').item.json.output.title_it }}, photography, realistic, sigma 85mm f/1.4",
        "options": {
          "size": "1536x1024"
        },
        "resource": "image"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "0425a8c8-9e98-4b09-b23e-31633a36ab6e",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1056,
        -880
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 736,
        "content": "## MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new **YouTube channel**](https://youtube.com/@n3witalia). Here I\u2019ll share videos and Shorts with practical tutorials and **FREE templates for n8n**.\n\n[![image](https://n3wstorage.b-cdn.net/n3witalia/youtube-n8n-cover.jpg)](https://youtube.com/@n3witalia)"
      },
      "typeVersion": 1
    },
    {
      "id": "686a42d5-2cae-40d2-b03f-83c818259f06",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -1456
      ],
      "parameters": {
        "color": 7,
        "width": 1056,
        "height": 1312,
        "content": "### Add this code in function.php\nYou can change the language code in the WF and in these functions. In this example from \"it\" to \"en\"\n\n```php\nadd_action('rest_api_init', function () {\n    register_rest_route('custom/v1', '/test', [\n        'methods' => 'GET',\n        'callback' => function () {\n            return ['ok' => true];\n        }\n    ]);\n});\n\nadd_action('rest_api_init', function () {\n\n    register_rest_route('custom/v1', '/link-translation', [\n        'methods' => 'POST',\n        'callback' => 'ew_link_translation',\n        'permission_callback' => '__return_true'\n    ]);\n\n});\n\nfunction ew_link_translation($request) {\n\n    $post_it = intval($request->get_param('post_it'));\n    $post_en = intval($request->get_param('post_en'));\n\n    if (!$post_it || !$post_en) {\n        return new WP_Error('missing_data', 'post_it e post_en obbligatori', ['status' => 400]);\n    }\n\n    if (!get_post($post_it) || !get_post($post_en)) {\n        return new WP_Error('invalid_post', 'Uno dei post non esiste', ['status' => 404]);\n    }\n    if (!has_filter('wpml_element_trid')) {\n        return new WP_Error('wpml_missing', 'WPML non attivo', ['status' => 500]);\n    }\n    $element_type = 'post_post';\n\n    $trid = apply_filters('wpml_element_trid', null, $post_it, $element_type);\n\n    if (!$trid) {\n        do_action('wpml_set_element_language_details', [\n            'element_id' => $post_it,\n            'element_type' => $element_type,\n            'trid' => false,\n            'language_code' => 'it',\n            'source_language_code' => null\n        ]);\n\n        $trid = apply_filters('wpml_element_trid', null, $post_it, $element_type);\n    }\n\n    do_action('wpml_set_element_language_details', [\n        'element_id' => $post_it,\n        'element_type' => $element_type,\n        'trid' => $trid,\n        'language_code' => 'it',\n        'source_language_code' => null\n    ]);\n\n    do_action('wpml_set_element_language_details', [\n        'element_id' => $post_en,\n        'element_type' => $element_type,\n        'trid' => $trid,\n        'language_code' => 'en',\n        'source_language_code' => 'it'\n    ]);\n\n    return [\n        'success' => true,\n        'trid' => $trid,\n        'post_it' => $post_it,\n        'post_en' => $post_en\n    ];\n}\n\n```"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "2f10fa9a-b805-4bbb-81ba-1282c88d2d83",
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set Prompt Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-5 Mini": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Article Text",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Post in Language 1": {
      "main": [
        [
          {
            "node": "Post in Language 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post in Language 2": {
      "main": [
        [
          {
            "node": "Link Translation Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Prompt Context": {
      "main": [
        [
          {
            "node": "Generate Article Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post Media to WP API": {
      "main": [
        [
          {
            "node": "Update Post Image Lang 1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Post Image Lang 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Article Text": {
      "main": [
        [
          {
            "node": "Post in Language 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Link Translation Posts": {
      "main": [
        [
          {
            "node": "Create Featured Image with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Article Text",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create Featured Image with AI": {
      "main": [
        [
          {
            "node": "Post Media to WP API",
            "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 generates an SEO-friendly blog post in Italian and English with OpenAI, publishes both versions to WordPress via the REST API, links them as WPML translations through a custom endpoint, generates a featured image, uploads it to the WordPress media library, and…

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

More Content & Video workflows → · Browse all categories →

Related workflows

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

Content & Video

WP. Uses openAi, outputParserStructured, chainLlm, httpRequest. Event-driven trigger; 63 nodes.

OpenAI, Output Parser Structured, Chain Llm +8
Content & Video

100% autonomous workflow that transforms YouTube videos into unique, high-quality, SEO-optimized blog articles and automatically publishes them to WordPress. No human intervention required: it uses Yo

HTTP Request, Stop And Error, Google Sheets +8
Content & Video

The best content automation in the market! This advanced workflow not only creates and publishes SEO-optimized blog posts to your WordPress website but also backs up all content and images to a design

OpenAI, Output Parser Structured, Chain Llm +8
Content & Video

This template is ideal for creators, bloggers, and automation enthusiasts who want to auto-generate blog posts from AI-generated content — without lifting a finger. Whether you're running a tech blog,

HTTP Request, WordPress, Rss Feed Read Trigger +4
Content & Video

Auto-Tag Blog Posts in WordPress with AI. Uses lmChatOpenAi, outputParserAutofixing, outputParserStructured, rssFeedReadTrigger. Event-driven trigger; 32 nodes.

OpenAI Chat, Output Parser Autofixing, Output Parser Structured +5