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
Auto categorize WordPress posts with n8n and AI Agent

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

Learn how to Build this Workflow with AI:

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


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.


Auto categorize WordPress posts with n8n and AI Agent

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.