🎬 Generate bilingual WordPress posts with OpenAI and WPML
⚡ 99 views · 🎬 Content Creation & Video
Description
Quick overview
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 assigns it to both posts.
How it works
- Runs manually when you click “Test workflow” in n8n.
- Sets a topic prompt used to generate the article.
- Uses OpenAI to produce structured output containing an Italian and English title and HTML article content.
- Creates the Italian WordPress post and then creates the English WordPress post via the WordPress REST API.
- Calls a custom WordPress REST endpoint to link the two posts as WPML translations.
- Generates a realistic cover image with OpenAI, uploads it to the WordPress media library, and sets it as the featured image for both posts.
Setup
- Add OpenAI credentials for text generation (chat model) and image generation (gpt-image-1).
- Add WordPress API credentials and replace all instances of
YOUR_URLwith your WordPress site URL. - Install and configure WPML with the
itandenlanguage codes (or update the workflow to match your site’s languages). - Add the provided PHP code to your theme’s
functions.php(or a custom plugin) to expose/wp-json/custom/v1/link-translation, and verify it is reachable. - Replace
YOUR_PROMPTwith your desired topic prompt before running the workflow.
Additional info
MY NEW YOUTUBE CHANNEL
👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n.
Need help customizing?
Contact me for consulting and support or add me on Linkedin
🔗 Nodes Used
HTTP Request, Basic LLM Chain, OpenAI Chat Model, Structured Output Parser, OpenAI
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File
