AI Content Enhancer for WordPress Posts - n8n Workflow

Automate content enrichment using this powerful n8n workflow. Fetch WordPress articles, generate AI summaries via GPT-4.1, and update posts automatically. Ideal for content marketing teams.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content managers looking to quickly enrich their existing article catalog with AI summaries and conclusions.
SEO specialists seeking to improve on-page structure and engagement using AI-generated content.
Users and developers interested in learning how to integrate complex custom logic (Code n8n node) with AI services.
Technical writers needing a reliable n8n workflow to automate repetitive content enhancement tasks.

Overview

Managing a large content library can be time-consuming, especially when implementing new editorial standards, such as adding standardized conclusions or engaging summary headings. This advanced n8n workflow solves this problem by completely automating the content enhancement process.

This robust n8n template uses the power of GPT-4.1 (via the OpenAI n8n node) to generate highly specific, SEO-optimized conclusions based on your existing article text. It handles the retrieval, cleaning (using a custom Code n8n node to strip HTML), AI processing, reformatting, and final publishing back to WordPress. This entire n8n automation is designed for high efficiency, ensuring your content is consistently updated without manual intervention, making this a crucial n8n workflow for any serious publishing platform.

How it Works

This n8n workflow is triggered manually and follows a strict linear path:


  1. Start: The process begins with the 'When clicking ‘Execute workflow’' n8n trigger, initiating the bulk content update operation.

  2. Fetch Content: An HTTP Request n8n node retrieves the target articles from the WordPress REST API using basic HTTP authentication. This typically fetches multiple items, which the n8n workflow processes in batches.

  3. Data Preparation: The 'Prepare Article Content Fields' n8n node simplifies the complex JSON output, extracting the post id, title, and content into easy-to-use variables.

  4. HTML Stripping: The ‘Format Article Content for Prompt’ Code n8n node performs a crucial step: it uses JavaScript scripting to remove all HTML tags from the article content, ensuring that the input sent to the AI is clean plain text, which greatly improves the quality of the AI response.

  5. AI Generation: The ‘Generate Heading & Summary Paragraph (AI)’ OpenAI n8n node executes a detailed, specialized prompt using GPT-4.1-mini. This prompt specifically instructs the AI to act as a content writer and generate a suitable heading and a high-engagement, three-line concluding paragraph.

  6. Output Formatting: The subsequent Code n8n node, ‘Format AI Output for Update,’ takes the original HTML content and appends the AI-generated text, separating it with an
    tag. It bundles the updated content and the post ID.

  7. WordPress Update: Finally, the ‘Update Article in WordPress’ HTTP Request n8n node sends a PATCH request back to the WordPress API, updating the article with the new content created by the n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Import the provided n8n workflow JSON into your n8n instance.

  2. API Credentials Setup: You will need two sets of credentials for the HTTP Request n8n nodes (used for fetching and updating WordPress posts).

* Set up a Generic Credential Type using HTTP Basic Auth. The username and password should correspond to an Application Password generated in your WordPress user profile, allowing API access.

  1. OpenAI Credentials: Configure the OpenAI API Key credential. This is required for the 'Generate Heading & Summary Paragraph (AI)' n8n node to access GPT-4.1.

  2. URL Customization: Update the URLs in both HTTP Request n8n nodes (Fetch Article Content (API) and Update Article in WordPress) to match your actual WordPress domain.

  3. Test: Execute the n8n workflow manually to ensure the connections are working and the articles are being updated correctly.

Node Details

This n8n workflow relies on several core nodes and services:

Manual Trigger (n8n trigger): Starts the n8n automation flow on demand.
HTTP Request (Fetch Article Content): Retrieves posts from the /wp/v2/posts endpoint. Key Configuration: Uses Basic HTTP Auth credentials and targets a specific API URL.
Set (Prepare Article Content Fields): Used to streamline the item data structure, specifically capturing the article id, title, and content for easy referencing throughout the n8n workflow.
Code (Format Article Content for Prompt): A custom n8n node utilizing JavaScript (rawHtml.replace(/<[^>]+>/g, ' ')) to convert complex HTML content into clean plain text, optimizing the AI prompt input.
OpenAI (Generate Heading & Summary Paragraph): The core AI engine. Key Configuration: Uses the gpt-4.1-mini model and includes a highly detailed system message prompt to guide the output structure (heading + 3-line summary).
Code (Format AI Output for Update): This n8n node constructs the final payload. Function: Concatenates the original HTML content with a separator (


) and the AI-generated summary, preparing the data for the final API call.

  • HTTP Request (Update Article in WordPress): Sends a PATCH request to update the specific post ID with the newly generated content. Key Configuration: Uses Basic HTTP Auth and sends a body containing the new content variable.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Automation & SEO Specialist with years of experience building smart workflows, AI-powered content solutions, and marketing automations. Skilled in n8n, WordPress, and API integrations to help businesses save time and grow faster.

Featured*