Auto-Tag Blog Posts in WordPress with AI n8n Workflow Template

n8n workflow template · 22 nodes · OpenAI

Auto-Tag Blog Posts in WordPress with AI is a free n8n workflow template that starts from the RSS Feed Trigger node and works with OpenAI, RSS and WordPress. It has 22 nodes, 5 of them AI nodes (OpenAI Chat Model, Auto-fixing Output Parser, Structured Output Parser and Basic LLM Chain). The notes inside the workflow say: “If you want your tags to follow a different case than I am using (dash case for slug, title case for name), then you will need to update a few nodes in this workflow.” To run it, you add your own credentials for OpenAI API and WordPress API.

At a glance

Trigger
RSS Feed Trigger (RSS Feed Trigger)
Nodes
22
Apps
OpenAI, RSS and WordPress
AI nodes
5
Credentials
2 types
Category
Content, SEO and social media

Apps and integrations

  • OpenAI
  • RSS
  • WordPress

Node types used

  • OpenAI Chat Model
  • Auto-fixing Output Parser
  • Structured Output Parser
  • RSS Feed Trigger
  • Edit Fields (Set)
  • Split Out
  • Loop Over Items
  • HTTP Request
  • Filter
  • Aggregate
  • If
  • Code
  • WordPress
  • Execute Workflow Trigger
  • Execute Workflow
  • Basic LLM Chain

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

! A note about cases!

If you want your tags to follow a different case than I am using (dash case for slug, title case for name), then you will need to update a few nodes in this workflow.

Auto-Tag Posts in WordPress

This workflow allows you to hand off the responsibility of tagging content for WordPress to an AI Agent in n8n with no data entry required.

What's this?

One of the few potential failure points in this workflow, when checking for missing tags it's important that both the generated tags and the existing tags are in the same case (snake, dash, title).

Ready for a challenge?

Make this subworkflow executable for both categories and tags, accounting for different API calls to different endpoints.

Copy this workflow

You can use it inline by removing the Called by Another Workflow trigger, or as-is as a subworkflow

What's this?

If there are missing tags we create them in WP, otherwise we keep get them all from WP and keep the relevant ones.

Demo Usage in Another Workflow (Tagging an article discovered with an RSS feed)

Handing off tagging and categorization fully to AI lets you put your WordPress account on autopilot without a human-in-the-loop.

In this example the application is use-case agnostic, but with this workflow you can

  1. Use AI to rewrite content with original thoughts and tags
  2. Ensure healthy information architecture on your site
  3. Quickly generate multivariate tag and category combinations for optimal SEO

To ensure data can be passed to subsequent nodes, make sure to select "Run Once for Each Item" if executing a subworkflow

About the maker

Find Ludwig Gerdes on LinkedIn

Nodes in this workflow

The 22 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. OpenAI Chat Model (OpenAI Chat Model)
  2. Auto-fixing Output Parser (Auto-fixing Output Parser)
  3. OpenAI Chat Model1 (OpenAI Chat Model)
  4. Structured Output Parser (Structured Output Parser)
  5. RSS Feed Trigger (RSS Feed Trigger)
  6. Return article details (Edit Fields (Set))
  7. Split Out (Split Out)
  8. Loop over articles (Loop Over Items)
  9. SET initial record (Edit Fields (Set))
  10. GET WP tags (HTTP Request)
  11. POST WP tags (HTTP Request)
  12. GET updated WP tags (HTTP Request)
  13. Keep matches (Filter)
  14. Combine tag_ids (Aggregate)
  15. Combine slugs (Aggregate)
  16. If (If)
  17. MOCK article (Edit Fields (Set))
  18. Return missing tags (Code)
  19. Wordpress (WordPress)
  20. Demo Usage in Another Workflow (Execute Workflow Trigger)
  21. Auto-Tag Posts in WordPress (Execute Workflow)
  22. Generate tags for article (Basic LLM Chain)

Credentials you need

  • OpenAI API – used by OpenAI Chat Model and OpenAI Chat Model1
  • WordPress API – used by GET WP tags, GET updated WP tags, POST WP tags and Wordpress

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us