WordPress: Set SEO
wp_set_seoSet the SEO title, meta description, canonical, robots directive and JSON-LD schema for one post or page. This is the highest-leverage on-page change available — core WordPress does not expose these over the API.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| site | Yes | ||
| type | No | post | |
| title | No | Aim for roughly 50-60 characters | |
| robots | No | e.g. 'noindex,follow' | |
| schema | No | JSON-LD as a JSON string, e.g. a LocalBusiness or FAQPage object | |
| confirm | No | Leave unset to preview. Set true only after the user has agreed to these exact fields. | |
| canonical | No | ||
| description | No | Aim for roughly 140-160 characters |