Skip to main content
Glama

Set SEO title and description

wp_seo_set
Destructive

Set a WordPress post's SEO title, meta description, or focus keyword in the active Yoast SEO or Rank Math fields; only supplied fields are overwritten.

Instructions

Set the SEO title, meta description and/or focus keyword of a post in the active SEO plugin's own fields: Yoast SEO, otherwise Rank Math (Yoast wins when both are active). Only the fields given are written, each overwriting the stored value; tags and line breaks are stripped. Returns updated, provider and changed (the fields written). With neither active the call is refused, also where All in One SEO is the SEO plugin; an unknown post is a not-found error. wp_seo_get reads the values. Needs edit_posts and the right to edit the post and each SEO field. No undo point is recorded.

Input Schema

NameRequiredDescriptionDefault
titleNoSEO title (the title tag the SEO plugin outputs), not the post title. Omitted: unchanged; an empty string stores an empty value.
post_idYesId of the post, page or other entry.
descriptionNoMeta description. Omitted: unchanged; an empty string stores an empty value.
focus_keywordNoFocus keyword (keyphrase) the SEO plugin analyses the post for. Omitted: unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.8.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructive and non-idempotent; the description adds real value beyond them, explaining that each supplied field overwrites the stored value, tags/line breaks are stripped, no undo point is recorded, and which capabilities are required. It also describes the return payload (updated, provider, changed).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A dense but front-loaded paragraph starting with the action and plugin precedence; each subsequent clause carries distinct information (overwrite behavior, sanitization, return values, failure modes, permissions, no undo).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Ample for a four-parameter mutation with no output schema: it covers write semantics, plugin selection, error/refusal conditions, auth requirements, and return fields. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and every field already documents omitted-vs-empty behavior, so the description adds only the summary that 'only the fields given are written.' That reinforces but does not extend the per-parameter semantics, making the baseline 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource (set SEO title/meta description/focus keyword) plus the exact plugin precedence (Yoast over Rank Math). Clearly distinguishable from the sibling wp_seo_get, which it names for reading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly redirects reading to wp_seo_get and enumerates when the call fails: neither plugin active, All in One SEO as plugin, or an unknown post. It doesn't contrast against wp_update_post for ordinary titles, but the when/when-not framing is otherwise strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools