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

Start free trial

Update Rank Math Post Schemas

rank-math/update-post-schemas adds or replaces schema markup on a post, term or user in a single call.

The key you use decides whether a schema is appended or replaced, and getting that wrong produces duplicates rather than an error.

At a glance

Abilityrank-math/update-post-schemas
ToolsetRank Math — toolset/rank-math
GroupRank Math › Schema
RequiresRank Math SEO, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

The key is the instruction

Key a schema new-1, new-2 and so on to append it. Key it schema-<meta_id> to replace an existing one.

Which means repeating a payload of new-* keys appends duplicates rather than overwriting. Retrying a call whose result you did not see is the standard way to end up with two identical Article schemas on one post — and duplicate structured data is worse than none, because it is ambiguous rather than absent.

So read the existing meta IDs first. Rank Math’s own rank-math/get-post-schema ability lists them, and also lists which schema types this install supports — which varies, because some types are PRO-only and some depend on other plugins being present.

Rank Math ships abilities of its own, and this suite deliberately does not duplicate them. Where one already answers a question well, these pages point at it rather than offering a second version that behaves slightly differently.

Not idempotent, by construction. That is a property of the append semantics rather than an oversight, and it is why the read comes first.

Input

NameTypeRequiredWhat it is
object_idintegerYesThe post, term or user ID.
object_typestringNo — defaults to postpost, term or user.
schemasobjectYesA map of key to schema. new-1 appends; schema-<meta_id> replaces.

What comes back

NameTypeWhat it is
object_idintegerThe object written.
schemasarrayThe schemas attached afterwards, with their meta IDs.
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:

Add FAQ schema to post 412.

It resolves to one call:

{
  "ability": "rank-math/update-post-schemas",
  "parameters": {
    "object_id": 412,
    "schemas": {
      "new-1": { "@type": "FAQPage" }
    }
  }
}

Worth knowing

  • Repeating a new-* payload appends duplicates. Read the meta IDs first.
  • Duplicate structured data is worse than missing structured data.
  • Supported schema types vary by install. Rank Math’s own read lists them.
  • Works on terms and users, not only posts.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading