30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Set Primary Term

taxonomies/set-primary-term sets which term Yoast treats as a post’s primary one in a taxonomy, controlling its breadcrumb trail and the category used in permalinks.

The term must already be assigned to the post.

At a glance

Abilitytaxonomies/set-primary-term
ToolsetYoast SEO — toolset/yoast-seo
GroupYoast SEO › Term SEO
RequiresYoast SEO, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

Setting a primary term the post does not have produces a breadcrumb trail through a category the post is not in. Nothing errors; the breadcrumb simply claims something untrue, and structured data emits it.

That is a peculiar kind of wrong — not broken, just false — which is why the assignment is checked rather than trusted.

On sites using category-based permalinks, changing the primary term changes the post’s URL. The old URL stops working, and WordPress does not redirect it, so that is a change that needs a redirect alongside.

On sites that do not use category permalinks, the effect is limited to breadcrumbs and the structured data built from them — still worth getting right, and much less consequential.

Idempotent.

Input

NameTypeRequiredWhat it is
post_idintegerYesThe post.
taxonomystringYesThe taxonomy.
term_idintegerYesThe term to make primary. Must be assigned to the post.

What comes back

NameTypeWhat it is
primary_termobjectThe primary term after the write.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Make Guides the primary category for post 412.

It resolves to one call:

{
  "ability": "taxonomies/set-primary-term",
  "parameters": {
    "post_id": 412,
    "taxonomy": "category",
    "term_id": 87
  }
}

Worth knowing

  • The term must be assigned to the post.
  • On %category% permalink sites this changes the URL — add a redirect.
  • Affects breadcrumbs and the structured data built from them.
  • Idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading