How to set the primary category for AI-generated WordPress posts

How to set the primary category for AI-generated WordPress posts
In lettura: How to set the primary category for AI-generated WordPress posts

WordPress doesn’t have a built-in “primary category” concept. By default, when a post belongs to multiple categories, WordPress picks alphabetically for the canonical URL — which is rarely what an editor wants. Yoast SEO and Rank Math both add a Primary Category field on top of WordPress to fix this. AI Content Generator assigns the categories themselves through the Base data metabox; the primary-category designation is a one-step alignment with whichever SEO plugin you have active.

This tutorial covers the full workflow: how the Base data Categories field works, how it interacts with Yoast / Rank Math Primary Category logic, the two strategies for choosing a primary (single-category per campaign vs explicit primary on multi-category campaigns), and the operational habits that keep your primary-category structure clean as the blog scales.

By the end you’ll have campaigns that always publish into the right primary category — for both SEO siloing and for the breadcrumb / canonical URL logic — without manual editing on every post.

Where AI Content Generator assigns categories

AI Content Generator Base data campaign metabox with category selection and content author rotation fields
The Base data metabox: every category you tick here gets assigned to every article this campaign produces. For primary-category logic, see the Yoast or Rank Math metabox section below.

Inside the Base data metabox of any campaign, the Categories list shows every WordPress category. Tick the ones the campaign should assign. Each generated article gets attached to all ticked categories. Untick the ones you don’t want.

Strategy 1 — One category per campaign (recommended)

The cleanest setup: each campaign publishes into exactly one category. With this strategy the “primary category” question never arises — the only category is also the primary by default. Yoast and Rank Math accept whichever single category is attached, no extra configuration needed.

This setup also produces the cleanest SEO siloing. Each post belongs to one cluster, the cluster owns the canonical URL, internal linking flows along clear topic boundaries. For 90% of editorial blogs this is the right configuration.

Strategy 2 — Multiple categories with explicit primary

Some campaigns genuinely span multiple categories — a tutorial about WordPress AI plugins legitimately belongs to “WordPress” and “AI” simultaneously. In this case the Base data Categories field gets multiple ticks, and the primary category needs explicit designation.

Pair the campaign with Yoast or Rank Math configured to honour a default primary category per author or per term. Both plugins expose this via their settings pages: the primary defaults to the first category in alphabetical order unless you override it. The cleanest workaround is to pin Extra AI instructions specifying which category should be primary: “Always make ‘AI Provider Integration’ the primary category when both AI and WordPress apply.”

Step 1 — Audit your existing category taxonomy

Before configuring campaigns, open Posts → Categories and walk through every category. Look for duplicates (“SEO” vs “Search Engine Optimization”), overly broad buckets (“General”), and orphan categories with zero posts. Clean these up first: merge duplicates, rename vague ones, delete the orphans.

A clean taxonomy is the prerequisite for clean primary-category assignment. AI Content Generator (and Yoast/Rank Math, and ultimately Google) all reflect whatever structure you give them. Garbage in, garbage out.

Step 2 — Assign categories per campaign

Open each campaign in the editor. In the Base data metabox, tick the Categories list for this campaign. The cleanest pattern: one campaign per category cluster. If you have four content clusters, you have four campaigns, each ticking one category.

If multiple campaigns genuinely target the same category (different tones, different sub-topics within one cluster), that’s fine — they all publish into the same bucket, and the SEO siloing remains clean. Multiple categories per campaign is the configuration to avoid unless you have a strong reason.

Step 3 — Configure Yoast or Rank Math primary defaults

Open Yoast (SEO → Search Appearance → Taxonomies) or Rank Math (Rank Math → Titles & Meta → Categories). Both plugins let you set how the primary category is determined when multiple are attached. The two practical options:

  • “Editor decides” — every post requires manual selection of the primary. Wrong for automated publishing because nobody will manually edit hundreds of generated posts.
  • “First alphabetical” or “By order” — the plugin picks deterministically. Use this and name your categories so the right one comes first alphabetically — e.g. “AI Plugins” comes before “WordPress” alphabetically.

Step 4 — Verify the primary on generated posts

After running a campaign, open one of the generated posts in the WordPress editor. Check the Yoast or Rank Math sidebar — the primary category should match your intent. If it doesn’t, the Step 3 configuration didn’t apply (Yoast and Rank Math sometimes cache primary-category logic).

A quick verification: hover the post on the public-facing breadcrumb. The breadcrumb shows the primary category as the parent of the post URL. If the breadcrumb is wrong, the primary is wrong, and you need to fix the Yoast/Rank Math defaults rather than fight every post by hand.

Step 5 — Audit monthly via Posts → Categories

Once a month, open Posts → Categories and scan the post counts. The distribution should match your editorial intent: each cluster grows at the rate you planned, no surprises in the “Uncategorized” bucket, no category bleeding 10× more than the others.

A category that exploded usually means a campaign was misconfigured — its Categories list includes a parent category that the AI applies to everything. A category stuck at zero growth usually means a paused campaign that nobody noticed.

Troubleshooting

  • Posts land in “Uncategorized” — the campaign’s Categories list has nothing ticked. Tick at least one.
  • Primary category alternates between two clusters on the same campaign — Yoast/Rank Math is set to “Editor decides”. Change it to a deterministic rule.
  • Breadcrumb shows the wrong primary — clear the Yoast/Rank Math cache (both plugins cache per-post breadcrumb data).
  • Canonical URL points to the wrong category — same fix as breadcrumb: Yoast/Rank Math determine the canonical from the primary category, so fix the primary, regenerate the canonical.
  • New category created after campaign launch isn’t selected — the campaign was saved before the category existed. Re-open the campaign editor, tick the new category, save.

You’re done

That’s the full primary-category workflow: assign categories per campaign via the Base data Categories field (one category per campaign is the cleanest), configure Yoast or Rank Math to determine the primary deterministically when multiple categories apply, verify on a sample post, audit monthly via Posts → Categories.

From here every article AI Content Generator publishes lands in the right primary category automatically. Breadcrumbs, canonical URLs and SEO siloing all stay aligned with your editorial intent — and the only manual step is the five-minute monthly review that catches misconfigurations early.

Shopping Basket
Scroll to Top