Auto-Categorize WordPress Posts with AI using n8n

This unique n8n workflow solves the tedious problem of manually categorizing WordPress blog posts by using AI-driven categorization. It automates assigning the most relevant category to each post, saving hours and eliminating costly errors in content organization.
wordpress
agent
lmChatOpenAi
+2
Workflow Identifier: 1696
NODES in Use: Manual Trigger, WordPress, Sticky Note, AI Agent, OpenAI Chat Model

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow automatically assigns the right category to every WordPress blog post using AI. It solves the problem of spending hours sorting posts manually and fixes mistakes in categories. Results come fast, with posts categorized correctly to help visitors find content easier and improve site structure.

It works by getting all posts from WordPress, letting AI check each post title, picking one best category ID from a fixed list, then updating each post inside WordPress with that category. This way, no manual category selection is needed.


Who should use this workflow

This workflow is good for those managing many WordPress blog posts and want to save time.

If a person spends hours fixing post categories or makes mistakes, this automation helps. It is easy to use without needing to know coding.


Tools and services used

  • n8n: Main automation platform for creating and running the workflow.
  • WordPress API: Reads and updates blog posts and categories on the website.
  • OpenAI API: AI service to analyze post titles and pick categories.
  • LangChain AI Agent node: Uses AI with a custom prompt to assign categories.

How this workflow works (Input → Process → Output)

Input

The workflow starts by fetching all blog posts from WordPress using the WordPress API using an API Key.

Process

The AI Agent node reads each post title and uses a fixed list of category IDs to pick one best category number. OpenAI Chat Model can be used before AI Agent for better understanding.

Output

Posts are updated in WordPress to include the AI-chosen category, making site categories accurate without manual work.


Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file from this page.
  2. In n8n editor, click on top-right menu, choose Import from File.
  3. Select the downloaded workflow file to import it inside your n8n workspace.

Step 2: Add credentials

  1. Open each WordPress node and add valid WordPress API credentials (API Key).
  2. Open the OpenAI Chat Model node and add your OpenAI API Key.

Step 3: Update IDs if needed

  1. Check if the AI Agent prompt category IDs match your WordPress categories. Change numbers or names if your site uses different categories.

Step 4: Test the workflow

  1. Click the Manual Trigger node and then press Execute Workflow.
  2. Check WordPress admin to confirm posts were categorized correctly.

Step 5: Activate for production

  1. Toggle the workflow to Active in n8n.
  2. Use manual trigger when you want to categorize new or changed posts.

Use self-host n8n if running this on your own server.


Customization ideas

  • Change the category list in AI Agent prompt to fit your WordPress taxonomy.
  • Limit posts fetched by the WordPress getAll node by turning off “Return All” and adding filters to select only new posts.
  • Add notifications with Email or Slack nodes after updating posts to get alerts when categorization finishes.

Common issues and fixes

  • If WordPress API authentication fails, check API key correctness and user permissions under WordPress > Users > Application Passwords.
  • If updated categories do not show in WordPress, verify that the post IDs and category ID fields are correctly mapped in the WordPress update node.

Summary

✓ Automatically assigns one main category to WordPress posts using AI.
✓ Saves hours of manual category editing.
✓ Uses WordPress API and OpenAI AI services.
✓ Helps organize blog content and improve visitor navigation.
✓ Simple to configure and run inside n8n by importing the workflow and adding credentials.


Frequently Asked Questions

The AI Agent node receives the post title and selects one primary category ID from a fixed list using an OpenAI model to determine the main topic.
WordPress API credentials with read and write permission and an OpenAI API Key are needed to fetch posts and assign categories.
Yes. The fixed list of category IDs and names is in the AI Agent prompt text and can be edited to match your WordPress site taxonomy.
Check that the post ID from the WordPress getAll node matches the post ID used to update categories, and confirm WordPress API credentials are correct.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free