Yoast SEO ability reference
Reference for the GoBuildWP Pro 1.12.4 and Free 1.18.6 source. Installed schemas and policy remain authoritative.
This Yoast SEO ability reference covers reading and editing Yoast's SEO fields for posts and terms, reading its site-wide settings and, with Yoast SEO Premium, managing its redirects. The agent works with readable field names such as seo_title and robots.index, and the module translates them into Yoast's own storage, including the numeric noindex codes that are easy to get backwards.
Read-only, write and destructive groups describe the source annotations. They do not establish a minimum safety profile, human approval or undo support. Those controls are separate: check the installed ability, the connected user and the active site policy before calling it. A read can still return sensitive data. These pages are not evidence that every operation passed an end-to-end runtime test.
What Yoast SEO needs before these load
2 of the 10 also ship in GoBuildWP Free 1.18.6 under the same names, marked “Also in GoBuildWP Free” below. They need no GoBuildWP Pro licence, but each retains its own dependency, feature and permission checks. Where Free's copy does less, its own description follows Pro's. When Pro's richer copy passes its gates, it registers first and answers.
Yoast SEO 21.0 or newer must be active. The module's gate reads the WPSEO_VERSION constant and compares it with that floor, so an older Yoast leaves every call unregistered. The four redirect calls also need Yoast SEO Premium: they register when WPSEO_PREMIUM_VERSION is defined, and check again for Yoast's redirect manager when called, answering yoast_redirects_unavailable if it is gone. Every call uses GoBuildWP's own permission check, which means manage_options (super admin on multisite). A call made after Yoast is deactivated returns yoast_not_active. Free's copies of the post get and edit are limited to the SEO title, meta description and robots, and check edit_posts plus the right to edit that post instead of manage_options.
- Minimum (base)
- 21.0
WPPILOT_PRO_YOAST_MIN_VERSION - Yoast SEO editions
- free, pro
- Agent skills shipped
yoast-integration
Where Yoast keeps post SEO and term SEO
A post's SEO is post meta under the _yoast_wpseo_ prefix, read and written through Yoast's WPSEO_Meta class rather than raw meta calls. That class slashes values itself before saving, so the module deliberately does not slash them again; a description or canonical containing a backslash is stored once, not doubled. The primary category is the exception, written straight to _yoast_wpseo_primary_category, and sending null removes it.
Terms work differently. Yoast stores the SEO of every category, tag and custom term in one site-wide option, wpseo_taxonomy_meta, through WPSEO_Taxonomy_Meta. A term edit reads that term's complete current array, lays the requested fields over it and writes the whole set back, so the fields you did not send keep their values.
The noindex codes, translated
Yoast stores a post's index setting in meta-robots-noindex as 0 for the post type default, 2 for index and 1 for noindex. The module reads and writes default, index and noindex instead, plus follow or nofollow, and does the mapping both ways. The advanced list accepts noimageindex, noarchive and nosnippet; any other token found in stored data is left out of the read.
Everything in a request is validated before anything is saved. A malformed robots block returns yoast_invalid_robots and none of the other fields in the same call are written, so a rejected request never leaves half its changes behind.
Undo for fields, none for redirects
Post edits take a before-image of the post and restore with wppilot/rollback-change. Term edits restore by putting the wpseo_taxonomy_meta option back as it was. That one option holds the SEO fields of every term, so rolling back a term edit also discards any term SEO change made after it, by a person or another agent; on a busy site, check recent term edits before restoring. Redirect writes are logged as irreversible, because Premium also exports its redirects to a server redirect file and restoring the stored option alone would leave that file out of step.
Before creating or editing a redirect, the module repeats the error checks Yoast's own validator runs: no line breaks or control characters, no origin that normalises to an empty path, no redirect to itself, and no origin that already exists in either the plain or regex format, which returns yoast_redirect_exists with status 409. Listing returns up to 500 rows per page.
Representative call sequence
This sequence describes the documented calls and checks to perform. It is not a recorded result from an installed WordPress site. Inspect returned errors and partial results, then verify the saved values and affected output before proceeding.
Give a post a focus keyphrase and a new meta description, then take the change back after the editor objects.
- 01
wppilot/yoast-get-post-seoReturns the post's current keyphrase, title, description and robots labels as the before state. - 02
wppilot/yoast-edit-post-seoCalled with just focus_keyphrase and meta_description; the other fields are left alone and the full updated SEO block comes back. - 03
wppilot/rollback-changeGiven the change id from that edit, restores the post's Yoast meta to its earlier values.
Questions about Yoast SEO
Why are there no redirect tools on my Yoast site?
They register when Yoast SEO Premium is active, since redirects belong to Premium's redirect module. On the free edition the post, term and settings calls are still there.
Can wppilot/rollback-change undo a Yoast redirect I deleted?
No. Redirect changes are logged as irreversible, so a delete cannot be undone from GoBuildWP. Note the origin, target and type from the list call before deleting; afterwards the only ways back are adding the redirect again by hand from those notes or restoring a backup.
Yoast SEO reads
| Ability | What it does |
|---|---|
wppilot/yoast-check-setupCheck Yoast SEO Setup | Reports the Yoast SEO environment: whether Yoast is active, edition (free or premium), version, whether redirects are available (Premium only), whether the XML sitemap is enabled, the configured brand identity (company or person), and the public post types and taxonomies whose SEO can be managed. Call this first before any other Yoast ability to confirm the runtime is ready and to learn which post types and taxonomies exist as targets. |
wppilot/yoast-get-post-seoGet Post SEO (Yoast)Also in GoBuildWP Free | Reads the Yoast SEO metadata for a single post or page in one friendly shape: focus_keyphrase, seo_title, meta_description, canonical, breadcrumb_title, cornerstone, robots (index: default|index|noindex, follow: follow|nofollow, advanced: list of noimageindex/noarchive/nosnippet), opengraph and twitter social previews, schema types, primary_category, and the Premium redirect. The raw Yoast indexing codes are mapped for you (Yoast stores noindex as 0=default/2=index/1=noindex). Identify the post by post_id (alias: id). Set include_scores to also return the computed read-only SEO / readability / inclusive-language scores. Never-set fields come back as their Yoast default, not as missing.In GoBuildWP Free: Reads one post's Yoast SEO title, meta description and robots. robots.index is default (follow the post type's setting, which is not the same as indexed), index (forced) or noindex; robots.follow is follow or nofollow. Yoast stores index as the codes 0/2/1; they are mapped for you. A field the post never set comes back as Yoast's default: an empty title or description means Yoast uses the post type template. Identify the post by post_id (alias: id). |
wppilot/yoast-get-settingsGet Yoast SEO Settings | Reads a curated snapshot of the site-wide Yoast SEO settings. scope selects which block(s) to return (default "all"): "general" = brand identity (company or person, names); "titles" = the title separator, homepage title/description templates, per-post-type and per-taxonomy title & meta-description templates and indexing (noindex) toggles, author/date-archive indexing, and whether breadcrumbs are enabled; "social" = OpenGraph/X (Twitter) toggles, default social image, the X card type, and the configured social profile URLs. Template strings use Yoast variables like %%title%%, %%sep%%, %%sitename%%. The separator is returned as Yoast's code (e.g. sc-dash). To CHANGE a setting, use wppilot/execute-php with WPSEO_Options::set($key, $value, $group); this ability reveals the keys and current values. |
wppilot/yoast-get-term-seoGet Term SEO (Yoast) | Reads the Yoast SEO metadata for a single taxonomy term (a category, tag, or custom-taxonomy term) in one friendly shape: focus_keyphrase, seo_title, meta_description, canonical, breadcrumb_title, cornerstone, robots (index: default|index|noindex - terms carry only the indexing toggle, no nofollow or advanced robots), and the opengraph / twitter social previews. Identify the term by term_id and its taxonomy. Term SEO is stored separately from post SEO (in the wpseo_taxonomy_meta option), which this ability reads for you. Never-set fields come back as their Yoast default. |
wppilot/yoast-list-redirectsList Redirects (Yoast Premium) | Lists the Yoast SEO Premium redirects as compact rows {origin, target, type, format}. Supports paging (limit, default 100, max 500; offset) and a case-insensitive substring search across origin and target. format filters to plain or regex (default all). Returns total (matching count before paging) so you can page through large redirect sets. Requires Yoast SEO Premium. |
Yoast SEO writes
| Ability | What it does |
|---|---|
wppilot/yoast-create-redirectCreate Redirect (Yoast Premium) | Creates a Yoast SEO Premium redirect from origin to target. type is the HTTP code: 301 (permanent, default), 302 (found), 307 (temporary), 410 (content deleted - no target), 451 (unavailable for legal reasons - no target). format is plain (default) or regex. Goes through Yoast's redirect manager so the export caches are regenerated and the redirect actually fires - never write the option directly. Fails if a redirect for the same origin already exists (edit it instead). Requires Yoast SEO Premium. |
wppilot/yoast-edit-post-seoEdit Post SEO (Yoast)Also in GoBuildWP Free | Updates the Yoast SEO metadata for a single post or page. Send only the fields you want to change - it is a partial merge; nested blocks (robots, opengraph, twitter, schema) merge field-by-field. Fields: focus_keyphrase, seo_title, meta_description (may use Yoast variables like %%title%% %%sep%% %%sitename%%), canonical, breadcrumb_title, cornerstone (bool), robots {index: default|index|noindex, follow: follow|nofollow, advanced: list of noimageindex/noarchive/nosnippet}, opengraph/twitter {title, description, image, image_id}, schema {page_type, article_type}, primary_category (term id, or null to clear), redirect (Premium). The friendly index labels are mapped to Yoast's raw codes for you (so you never risk the 0/2/1 noindex trap). Identify the post by post_id (alias: id). Returns the full updated SEO. In GoBuildWP Free: Sets one post's Yoast SEO title, meta description and robots. Send only the fields to change: seo_title and meta_description (plain text; Yoast variables such as %%title%% %%sep%% %%sitename%% work, and an empty string clears the override so the post type template applies), robots.index (default | index | noindex; default follows the post type setting) and robots.follow (follow | nofollow). Everything is validated before anything is written. Returns the fields that changed and the re-read values. Recorded in the change log with a before-image of just the Yoast meta keys it wrote; wppilot/rollback-change restores them and Yoast rebuilds the page's cached SEO data. |
wppilot/yoast-edit-redirectEdit Redirect (Yoast Premium) | Edits an existing Yoast SEO Premium redirect, identified by its current origin. Optionally change the destination (target), the HTTP type (301/302/307/410/451), and/or the origin itself (new_origin). The redirect's format (plain/regex) is preserved; to change format, delete and recreate. Goes through Yoast's redirect manager so the export caches are regenerated. Requires Yoast SEO Premium. |
wppilot/yoast-edit-term-seoEdit Term SEO (Yoast) | Updates the Yoast SEO metadata for a single taxonomy term (category, tag, or custom-taxonomy term). Send only the fields you want to change - it is a partial merge; the ability reads the term's current SEO and writes the full set back so untouched fields are preserved (Yoast would otherwise reset them). Fields: focus_keyphrase, seo_title, meta_description, canonical, breadcrumb_title, cornerstone (bool), robots {index: default|index|noindex}, opengraph/twitter {title, description, image, image_id}. Terms carry only the indexing toggle (no nofollow / advanced robots / schema). Identify the term by term_id + taxonomy. Returns the full updated SEO. The change ledger's before-image is the whole wpseo_taxonomy_meta option, which holds every term's Yoast SEO, so a rollback writes all terms back to that moment; on a site where other people edit term SEO, check other terms after undoing. |
Destructive Yoast SEO calls
| Ability | What it does |
|---|---|
wppilot/yoast-delete-redirectDelete Redirect (Yoast Premium) | Deletes the Yoast SEO Premium redirect with the given origin. Goes through Yoast's redirect manager so the export caches are regenerated. Errors if no redirect matches the origin. Requires Yoast SEO Premium. |
For the task-level view of Yoast SEO, with worked requests and what to check afterwards, see Yoast SEO integration page.