All templates

Marketing

WordPress Post Categorizer

Read WordPress post pages, classify every title into one configured category, validate the complete batch and replace each post’s category assignment.

WordPress Post Categorizer workflow in Open FlowWordPress Post Categorizer workflow in Open Flow

Classify WordPress post titles into one of your existing categories, validate the whole batch and replace each post’s category assignment.

Setup

The Open Flow JSON contains two workflows, WordPress Post Categorizer and WordPress Category Classifier. Import the bundle so both are created together. Configure the model service on the classifier, publish that worker, and refresh the classify-post workflow capability on Classify one post title in the main workflow. Select the imported classifier as its target. The shared file has no published revision; the worker must be configured, published and refreshed before remote execution.

Use the same WordPress account on Read one WordPress post page and Apply one validated category. The account must be able to read the posts and edit their categories. The model is gpt-5-mini, with provider-default generation settings.

OpenAI lists December 11, 2026 as the shutdown date for gpt-5-mini. Select an available model in both formats before that date and recheck category responses and the selected model’s generation settings.

For n8n, choose WordPress credentials on the two native WordPress nodes and an OpenAI credential on OpenAI Chat Model. Edit Set Category Taxonomy before executing. Its initial [] is a placeholder and stops before any post read or update.

Run

Create the desired categories in WordPress beforehand. Supply taxonomyJson as JSON text in the main Open Flow workflow, or the same text in n8n’s settings node. Use the actual IDs from your site. For example, if IDs101 and102 belong to these categories:

[
  { "id": 101, "name": "Content Creation" },
  { "id": 102, "name": "Digital Marketing" }
]

The workflow reads the WordPress post collection using its default filters and ordering. It follows the page count reported by WordPress, with ten posts per page, before starting classification. Standard WordPress defaults select published posts, newest first. Correct pagination headers are required for complete coverage; a site that omits the page-count header provides only one page to either format. Keep the collection stable during listing: page-based reads are not an atomic snapshot. Repeated post IDs or malformed titles stop before the model or writes.

Each title is classified once into one configured category. All classifications must complete and pass the allowlist check before any update is attempted. An empty collection returns a zero-count summary. Categories are replaced with exactly one chosen ID; existing category assignments are removed by that replacement. No categories are created, and post content, tags and publication status are not included in the update.

Updates run one at a time in collection order. A failed update stops later updates and leaves earlier changes completed. There are no workflow-level retries or rollback. Each successful rerun reclassifies and replaces categories for the selected collection again. The n8n model adapter permits two additional transient transport retries; Open Flow’s selected model service controls its own transport retry behavior. A failed classification causes no post updates. The three visible feedback loops read one page, classify one title and update one post in separate executions. There is no fixed 100-post or 100-page total cap. The accumulated titles and category assignments must fit the execution platform’s Code input and result budgets; the inspected Open Flow host allows 1 MiB for each. A limit failure stops the run, and earlier completed updates remain if it occurs during the write phase. Model-service and overall execution limits also apply.

The result contains the requested {id, categoryId} assignments and a count after all update calls succeed. These are the selected assignments, not an independent read-back audit. Post titles and the configured category names are sent to the model service. Choosing a category is a model judgment; review the taxonomy and test on a suitable WordPress site before running across the collection.

Changes to the source

  • Replace the tool-less Agent with an ordinary LLM Chain in n8n and a visible single-post classifier workflow in Open Flow.
  • Make the current native model default explicit and preserve the source’s default system message and full title/category prompt.
  • Replace the source’s site-specific category IDs with required user configuration.
  • Read all reported pages, preserve collection order, and validate the complete batch before updates.
  • Reject out-of-taxonomy model responses and send category IDs as numeric arrays.
  • Keep read, classification and write phases separate, with explicit empty-collection output and partial-write failure behavior.

Adapted from Auto-Categorize blog posts in wordpress using A.I. in enescingoz/awesome-n8n-templates. The export links to this case study by Keith Rumjahn and its accompanying video tutorial; it does not state a separate template license.

Source collection notice: © 2024–2026 Enes Cingoz, CC BY 4.0. See repository licensing for the scope of OOMOL contributions and third-party material.