Auto Categorize WordPress Posts with n8n and AI

Discover how to automatically categorize 82 WordPress blog posts in just 2 minutes using an n8n workflow combined with OpenAI’s AI language model. This automation streamlines content organization by assigning precise categories based on post titles, saving hours of manual work and minimizing errors.
wordpress
agent
lmChatOpenAi
+2
Workflow Identifier: 1677
NODES in Use: Manual Trigger, WordPress, Sticky Note, AI Agent, OpenAI Chat Model
Auto categorize WordPress posts with n8n and AI

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

Learn how to Build this Workflow with AI:

What This Automation Does

This n8n workflow automatically sorts blog posts by category on a WordPress site. It stops the need for manual sorting and reduces mistakes by assigning a single relevant category based on the post title.

The workflow fetches all posts, sends titles to AI for category selection, and updates posts with the chosen category, saving hours of manual work.


Tools and Services Used

  • WordPress REST API: Provides access to blog posts and allows updating post categories.
  • OpenAI API: Processes post titles to determine best category using a custom prompt.
  • n8n Workflow Automation Platform: Links WordPress and OpenAI nodes and manages task automation.

Input → Process → Output

Inputs

Processing Steps

Output

  • All WordPress posts have an updated primary category set accurately.
  • The user saves over 3 hours weekly on manual post sorting.

Beginner Step-by-Step: Using This Workflow in n8n

Importing the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor you already use.
  3. Click on Import, then choose “Import from File” to add the workflow into n8n.

Configuring Credentials

  1. Add your WordPress API credentials in the WordPress nodes.
  2. Insert your OpenAI API key in the AI Agent node credentials.
  3. Check and update category IDs in the AI Agent prompt if changes apply.

Testing and Activation

  1. Run the workflow once using the Manual Trigger node “Execute Workflow” button to verify it works.
  2. Confirm categories update correctly in your WordPress admin panel.
  3. Activate the workflow within n8n to use it in production.
  4. Optionally set schedule or manual triggers as needed.
  5. Consider self-host n8n if running on your own server.

Common Issues and Fixes

401 Unauthorized Errors

Check WordPress API credentials in n8n. Make sure API keys have permission to access posts.

AI Agent Returns No or Wrong Category

Make sure AI prompt text is copied exactly. Verify OpenAI API key is active and valid.

Posts Not Updating

Double-check dynamic expressions used for postId and categories fields. IDs must match WordPress post data and AI output format.


Customization Ideas

  • Change the category list in AI prompt to your own taxonomy.
  • Limit how many posts run by adjusting the WordPress getAll node.
  • Modify AI prompt to return category names if preferred and change update node mapping accordingly.

Summary of Benefits

✓ Saves time by automating post categorization.
✓ Reduces errors from manual sorting.
✓ Improves site navigation with consistent categories.
✓ Works fast on 80+ posts in minutes.
Easy to run and customize inside n8n.


Auto categorize WordPress posts with n8n and AI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow fetches posts, sends titles to OpenAI AI Agent node with a prompt, receives a category ID, then updates each post’s category accordingly.
Users must have WordPress API credentials, an OpenAI API key, and access to an n8n editor to import and configure the workflow.
Yes, the category list is set in the AI Agent node prompt and can be edited to match custom WordPress categories.
Incorrect or missing WordPress API credentials cause 401 errors. Check and reenter credentials in the WordPress nodes.

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.