Rank Math ability reference
Reference for the GoBuildWP Pro 1.12.4 and Free 1.18.6 source. Installed schemas and policy remain authoritative.
This Rank Math ability reference covers Rank Math's SEO fields for posts and terms, its settings, per-post schema type, redirections and 404 log. Several of those register according to which Rank Math modules are switched on, so two sites running the same Rank Math version can offer an agent different tools.
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 Rank Math needs before these load
2 of the 13 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.
Rank Math 1.0.200 or newer must be active; the gate compares the RANK_MATH_VERSION constant with that floor. The schema calls register when the rich-snippet module is enabled in the rank_math_modules option, the redirect calls with the redirections module, and the 404 log with 404-monitor, because those modules own the tables the calls read. Every call needs manage_options (super admin on multisite) through GoBuildWP's own permission check, and the redirect and 404 calls test manage_options again directly. With Rank Math inactive a call returns rank_math_not_active. The free plugin's post calls cover title, description and robots only, keep the noarchive, noimageindex and nosnippet tokens, and are gated on edit_posts and edit_post; the score, keywords and social fields are Pro's.
- Minimum (base)
- 1.0.200
WPPILOT_PRO_RANK_MATH_MIN_VERSION - Rank Math editions
- free
- Agent skills shipped
rank-math-integration
A stored redirect is not always a served one
Rank Math builds its module manager after its setup wizard has been finished or skipped, or an account connected. Before that, its redirect classes still load and its table still accepts rows, so a create would appear to work while nothing ever redirects. The redirect calls look for the running Redirections module in that manager and, when it is absent, return rank_math_redirects_not_served with a message saying whether the wizard or the module switch is the cause.
Rank Math's model has two further traps. Its save quietly updates whichever active redirect already has a matching source instead of adding a row, so create checks first and refuses with rank_math_redirect_exists (409, carrying the existing id). Its database update resets any column it is not given to a default, such as status active and code 301, so edits are merged onto the stored row before saving. Exact sources are stored without their leading slash.
Trash, permanent delete and the ledger
Deleting moves a redirect to Rank Math's trash by default; permanent=true removes the row. Both need confirm=true, and without it the call returns wppilot_confirmation_required naming the source and target that will stop redirecting. Redirects live in the rank_math_redirections and rank_math_redirections_cache tables, so every redirect write is logged as irreversible; a trashed redirect is a status on that same row and is recovered in Rank Math's own screen, not through GoBuildWP.
Post fields are post meta (rank_math_title, rank_math_description, rank_math_robots as a list of tokens, rank_math_focus_keyword as a comma-separated string), so post SEO and schema edits restore with wppilot/rollback-change. Setting a schema type clears the post's existing rank_math_schema_ entries, their shortcode companions and the legacy rank_math_rich_snippet field before writing one primary entry. Term SEO is term meta, which the ledger's term snapshot does not hold, so those edits are marked irreversible.
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.
Turn the missing URLs visitors hit most often into redirects.
- 01
wppilot/rank-math-list-404sOrdered by times_accessed, returns the logged URIs with hit counts, referrers and user agents, most-requested first. - 02
wppilot/rank-math-create-redirectCreates a 301 from a logged URI to its replacement page, or refuses with the id of an existing redirect that already covers that source. - 03
wppilot/rank-math-list-redirectsSearched by the new source, confirms the row is stored and active. A stored row is not proof the redirect is served: request the old URI from outside the site (for example with curl -I) and check for a 301 whose Location is the replacement page.
Questions about Rank Math
The Rank Math redirect tools are missing. Why?
They register when the Redirections module is enabled in Rank Math's module list. Switch it on under Rank Math's modules, and finish or skip the setup wizard, or the calls will refuse because nothing would be served.
Can I restore a Rank Math redirect I deleted?
A trashed redirect can be restored from Rank Math's own trash; one deleted with permanent=true is gone. GoBuildWP's rollback cannot restore either, because the rows live in Rank Math's own tables.
Rank Math reads
| Ability | What it does |
|---|---|
wppilot/rank-math-check-setupCheck Rank Math Setup | Reports the Rank Math SEO environment: whether Rank Math is active, its version, which modules are enabled (e.g. rich-snippet/schema, redirections, sitemap, local-seo), and the public post types and taxonomies whose SEO can be managed. Module-gated abilities (like the schema abilities, which need the rich-snippet module) check this. redirections_served is false while Rank Math's setup wizard is neither finished nor skipped: its redirections module is then not running and stores redirects it never serves. Call this first before any other Rank Math ability. |
wppilot/rank-math-get-post-schemaGet Post Schema (Rank Math) | Reads the Rank Math schema (rich snippet) for a post: any per-post schema entries (with their @type and whether each is primary) and the default_type the post inherits from its post-type setting when it has no per-post schema. Requires the Rank Math rich-snippet (Schema) module. Identify the post by post_id (alias: id). |
wppilot/rank-math-get-post-seoGet Post SEO (Rank Math)Also in GoBuildWP Free | Reads the Rank Math SEO metadata for a single post or page in one friendly shape: focus_keywords (list), seo_title, meta_description, canonical, pillar_content (cornerstone), robots (index: default|index|noindex, follow: follow|nofollow, advanced: list of noarchive/noimageindex/nosnippet), facebook and twitter social previews, primary_category, and schema_type. Rank Math stores robots as a token array where index/noindex are mutually exclusive and "default" means inherit the post-type setting - this ability maps it for you. Identify the post by post_id (alias: id). Set include_score to also return the computed read-only SEO score. Never-set fields come back empty / default. In GoBuildWP Free: Reads one post's Rank Math SEO title, meta description and robots. robots.index is default (no index or noindex token stored, so the post type's setting applies; not the same as indexed), index or noindex; robots.follow is follow or nofollow. An empty title or description means Rank Math uses the post type template. Identify the post by post_id (alias: id). |
wppilot/rank-math-get-settingsGet Rank Math Settings | Reads a curated snapshot of the site-wide Rank Math settings. scope selects the block(s) (default "all"): "general" = title separator and the knowledge-graph identity (organization or person, name); "titles" = homepage title/description templates plus per-post-type and per-taxonomy title & description templates and the EFFECTIVE default robots (index/follow/advanced) for each, with a custom_robots flag (false = the type inherits the site-wide default, which is what robots then reflects; true = it has its own per-type override). Template strings use Rank Math variables like %title%, %sep%, %sitename%. To CHANGE a setting use wppilot/execute-php (read the shared rank-math-options-* option, merge, update_option) - this ability reveals the keys and current values. |
wppilot/rank-math-get-term-seoGet Term SEO (Rank Math) | Reads the Rank Math SEO metadata for a single taxonomy term (category, tag, or custom-taxonomy term) in one friendly shape: focus_keywords, seo_title, meta_description, canonical, robots (index: default|index|noindex, follow: follow|nofollow, advanced), and the facebook / twitter social previews. Identify the term by term_id and taxonomy. Rank Math stores term SEO as ordinary term meta, which this ability reads and maps for you. Never-set fields come back empty / default. |
wppilot/rank-math-list-404sList 404 Log (Rank Math) | Lists Rank Math's 404 Monitor log (uri, times_accessed, last accessed, referer, user agent), paginated. orderby times_accessed finds the missing URLs that matter most; pair it with rank-math-create-redirect. Requires the 404 Monitor module. |
wppilot/rank-math-list-redirectsList Redirects (Rank Math) | Lists Rank Math redirections (Redirections module), newest first, paginated. search matches sources and targets. status: active, inactive, trashed, or any (default: everything but trashed). Each row: id, sources [{pattern, comparison, ignore_case}], target, code, status, hits, created, updated. Exact sources are stored without their leading slash. |
Rank Math writes
| Ability | What it does |
|---|---|
wppilot/rank-math-create-redirectCreate Redirect (Rank Math) | Creates a Rank Math redirection through its Redirection model. Pass source (one exact path) and/or sources [{pattern, comparison}], a target and a code (default 301). Refuses an exact source another redirect already has - Rank Math's save would otherwise silently overwrite that redirect - and a target equal to a source. Refuses, with the fix, when Rank Math's redirections module is not actually running (setup wizard not finished or skipped, or the module off), because Rank Math would store the redirect and never serve it. |
wppilot/rank-math-edit-post-seoEdit Post SEO (Rank Math)Also in GoBuildWP Free | Updates the Rank Math SEO metadata for a single post or page. Send only the fields to change - it is a partial merge; nested blocks (robots, facebook, twitter) merge field-by-field. Fields: focus_keywords (list), seo_title, meta_description (may use Rank Math variables like %title% %sep% %sitename%), canonical, pillar_content (bool), robots {index: default|index|noindex, follow: follow|nofollow, advanced: list of noarchive/noimageindex/nosnippet}, facebook/twitter {title, description, image, image_id}, primary_category (category term id, or null to clear). The friendly robots labels are mapped to Rank Math's token array for you (so you never build a contradictory or empty robots set). Identify the post by post_id (alias: id). Returns the full updated SEO. Edit the schema type via the schema abilities. In GoBuildWP Free: Sets one post's Rank Math SEO title, meta description and robots. Send only the fields to change: seo_title and meta_description (markup is stripped, Rank Math variables such as %title% and %sep% are kept, and an empty string clears the override), robots.index (default | index | noindex; default follows the post type setting) and robots.follow (follow | nofollow). A robots change keeps the post's noarchive, noimageindex and nosnippet tokens. 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 Rank Math meta keys it wrote; wppilot/rollback-change restores them. |
wppilot/rank-math-edit-term-seoEdit Term SEO (Rank Math) | Updates the Rank Math SEO metadata for a single taxonomy term (category, tag, or custom-taxonomy term). Send only the fields to change - it is a partial merge; the robots block merges field-by-field. Fields: focus_keywords (list), seo_title, meta_description, canonical, robots {index: default|index|noindex, follow: follow|nofollow, advanced: list of noarchive/noimageindex/nosnippet}, facebook/twitter {title, description, image, image_id}. Rank Math stores term SEO as ordinary term meta. Identify the term by term_id + taxonomy. Returns the full updated SEO. |
wppilot/rank-math-update-redirectUpdate Redirect (Rank Math) | Changes a Rank Math redirection by id. Only the fields sent change (the stored row is merged first - Rank Math's DB::update resets anything it is not given). Sending source or sources replaces the whole source list. |
Destructive Rank Math calls
| Ability | What it does |
|---|---|
wppilot/rank-math-delete-redirectDelete Redirect (Rank Math) | Removes a Rank Math redirection by id. Default moves it to Rank Math's trash (restorable in Rank Math's UI for 30 days, then purged by Rank Math); permanent=true deletes the row. Requires confirm=true either way. The ledger cannot restore it. |
wppilot/rank-math-edit-post-schemaEdit Post Schema (Rank Math) | Sets the Rank Math schema (rich snippet) type for a post. schema_type is the schema.org type (Article, BlogPosting, NewsArticle, Product, Course, Event, Recipe, Book, JobPosting, Service, SoftwareApplication, VideoObject, Person, Restaurant) or "off" to remove the per-post schema (the post then inherits the post-type default). This replaces the post's per-post schema with a single primary entry of the chosen type; Rank Math fills the rest of the properties from its template. Requires the rich-snippet module. Identify the post by post_id (alias: id). Returns the resulting schema state. |
For the task-level view of Rank Math, with worked requests and what to check afterwards, see Rank Math integration page.