Update WordPress SEO Meta (Yoast)
wp_update_seo_metaUpdate Yoast SEO meta on WordPress posts and pages: set titles, descriptions, canonical URLs, noindex, focus keywords, and social share overrides via the REST API.
Instructions
Update Yoast SEO meta on a post or page: title, description, canonical, noindex, focus keyword, OG, Twitter. Writes via WP REST's meta sub-object using Yoast's underlying postmeta keys.
Args:
content_type (enum): post | page. Required.
id (number): ID of the post/page. Required.
meta_title, meta_description, canonical_url, focus_keyword: optional strings.
noindex (boolean): true = noindex, false = index, undefined = leave Yoast's default.
og_title, og_description, twitter_title, twitter_description: optional social-share overrides.
response_format (enum): markdown | json. Default 'markdown'.
Returns: The updated content item (with the new Yoast meta applied — re-fetch with wp_get_seo_meta to verify rendering).
Note: This is for Yoast specifically. RankMath / AIOSEO sites need different keys (not supported in v1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Numeric ID of the post or page. | |
| noindex | No | If true, sets robots noindex. If false, sets robots index. Leave undefined to use Yoast's default. | |
| og_title | No | Open Graph title override (Facebook/LinkedIn share). | |
| meta_title | No | SEO title (Yoast). Shown in search results. Recommended 50-60 chars. | |
| content_type | Yes | Whether the target is a post or a page. | |
| canonical_url | No | Canonical URL. Pass empty string to clear and let Yoast auto-set. | |
| focus_keyword | No | Yoast focus keyword for the analysis tool. | |
| twitter_title | No | Twitter card title override. | |
| og_description | No | Open Graph description override. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |
| meta_description | No | SEO description (Yoast). Recommended 150-160 chars. | |
| twitter_description | No | Twitter card description override. |