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
| Ability | taxonomies/set-primary-term |
| Toolset | Yoast SEO — toolset/yoast-seo |
| Group | Yoast SEO › Term SEO |
| Requires | Yoast SEO, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI 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
| Name | Type | Required | What it is |
|---|---|---|---|
post_id | integer | Yes | The post. |
taxonomy | string | Yes | The taxonomy. |
term_id | integer | Yes | The term to make primary. Must be assigned to the post. |
What comes back
| Name | Type | What it is |
|---|---|---|
primary_term | object | The primary term after the write. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present 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 Primary Term — read the current choice
- Update Breadcrumb Settings — the wider breadcrumb setup
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category