Rank Math MCP — Edit Rank Math SEO with an AI Agent
What is Rank Math MCP?
Rank Math MCP means fixing your site's SEO metadata by asking an AI assistant, instead of opening each post and working through the Rank Math panel. Cowboy MCP gives an AI agent 4 SEO tools over the Model Context Protocol that read, write and audit the per-post fields Rank Math stores — SEO title, meta description, focus keywords, robots, canonical URL, Facebook and X/Twitter overrides and the pillar-content flag — and read back the SEO score Rank Math keeps for each post.
MCP is the open standard an AI client such as Claude or ChatGPT uses to discover and call those tools. The free Cowboy MCP plugin detects Rank Math when it is active and writes to Rank Math's own fields, so what the agent changes is exactly what you would see in the Rank Math panel of the post. The same tools also work with Yoast SEO, All in One SEO and SEOPress; this page covers what is specific to Rank Math.
Doesn't Rank Math have its own MCP tools?
Yes, and they do different work. Since version 1.0.271 (May 2026), Rank Math registers about thirty abilities of its own through the WordPress Abilities API: site-wide SEO audits and one-click fixes for failing tests, settings, the sitemap and robots.txt, redirections and 404 logs, link reports, a post's SEO score and schema, and Rank Math's AI Visibility reports. Since 1.0.281 (3 November 2026) they reach an AI app through the official MCP Adapter plugin, as Rank Math's MCP tools guide (opens in new tab) describes.
Rank Math's abilities read a post's SEO meta, but none of them sets one post's title, description or focus keyword — that per-post editing is what Cowboy MCP's tools add, with a dry run and an undo for every write. The two work side by side: on WordPress 6.9 or newer, Cowboy MCP also serves Rank Math's own abilities to your AI app, next to its SEO tools, with no separate adapter plugin. They run Rank Math's own permission checks, and because Cowboy MCP cannot record what they change beforehand, their changes are logged but not in the undo journal.
What can an AI agent do with Rank Math?
An agent can do the Rank Math housekeeping that rarely gets done by hand: write a meta description for every post that has none, set focus keywords where they are missing, shorten SEO titles that run past 60 characters, noindex thin tag-like pages, mark your cornerstone guides as pillar content, or give a post its own X/Twitter card. Here are the 4 tools, with the real identifiers the agent sees.
| Tool | What it does on a Rank Math site |
|---|---|
wp_seo_get_provider |
Confirm Rank Math is the active SEO plugin, report its version, and warn if another SEO plugin is active at the same time |
wp_seo_get_meta |
Read a post's Rank Math fields and the SEO score Rank Math last stored for it |
wp_seo_update_meta |
Change any of those fields; fields you do not name stay as they are, and an empty value clears the override so Rank Math's title and description templates take over again |
wp_seo_audit |
Scan posts and pages for missing or badly sized meta descriptions, missing focus keywords, SEO titles over 60 characters and noindex on published posts, a page of posts at a time |
Which Rank Math fields does it read and write?
Every field maps one to one onto the post meta Rank Math itself uses, so nothing is stored in a side table and nothing needs syncing back.
| Field the agent uses | Rank Math field | Notes |
|---|---|---|
title |
rank_math_title |
Template variables such as %title% and %sep% are kept as written |
description |
rank_math_description |
|
focus_keyword |
rank_math_focus_keyword |
Several keywords, comma-separated, as Rank Math allows; the first is the primary one |
noindex · nofollow |
rank_math_robots |
Only that directive is added or removed; others on the post, such as noarchive or nosnippet, are left alone |
canonical_url |
rank_math_canonical_url |
|
og_title · og_description · og_image |
rank_math_facebook_title · _description · _image |
Setting the image also updates the matching attachment ID, so Rank Math does not keep showing the old one |
twitter_title · twitter_description · twitter_image |
rank_math_twitter_title · _description · _image |
Setting any of them switches off "use Facebook data" for that post, so the X/Twitter card shows what you set |
cornerstone |
rank_math_pillar_content |
Rank Math's pillar-content flag |
| SEO score (read only) | rank_math_seo_score |
The score Rank Math last stored; Rank Math does not keep a separate readability score |
Three real prompts, to make it concrete:
- "Audit every published post and write a Rank Math meta description for each one that is missing it — under 160 characters, in the voice of the post."
- "Set two or three focus keywords on each of my ten newest guides, based on what each one is actually about, and show me the list before you save."
- "Mark the five guides in the Start Here category as pillar content, and noindex every post in the Announcements category older than 2024."
How do Rank Math edits stay safe?
A stray noindex can pull a page out of Google, so SEO writes get the same guardrails as every other change Cowboy MCP makes. The provider check, the reads and the audit never change anything.
- Dry run —
wp_seo_update_metacan show exactly what it would change on a post without saving, so a bulk description pass can be checked on a few posts first. - Undo journal — each write is captured with the previous values, so a bad description or a mistaken noindex rolls back from the Activity tab, or by asking the agent to undo it.
- Partial updates — only the fields you name change; clearing a field hands the post back to Rank Math's own template instead of leaving it blank.
- One plugin at a time — if Yoast SEO is also active, the provider check says so and the tools work with Yoast, which Cowboy MCP reads first; running two SEO plugins usually prints duplicate meta tags, so it is worth fixing either way.
Every call is also written to the audit log, and your MCP client asks you to approve each tool call. The full guardrail model is on the security page.
What are Rank Math MCP's limits?
The tools work with per-post fields — what sits in the Rank Math panel of each post or page. Rank Math's site-wide settings stay in its own screens: title and description templates, the sitemap, redirections, the 404 monitor, schema templates, local SEO and the modules you switch on or off. Per-post schema markup is not edited by these tools either.
The SEO score is read, not recalculated: the tool returns the number Rank Math last saved for the post, and Rank Math works it out again when the post is analysed in its editor. The audit is a fixed set of checks on what is stored in the database — description present and 50–160 characters, a focus keyword set, a custom title of at most 60 characters (titles built from template variables are skipped, since their length is only known once Rank Math fills them in), no noindex on a published post — not a crawl and not a ranking tool, and it covers one page of posts per call, so a full-site audit is a loop the agent runs. Think of the agent as a fast, careful editor for metadata: it will write a hundred descriptions before lunch, but what each page should rank for is still your call.
How do I set it up?
Setup takes about five minutes and needs no code or API key. With Rank Math already active, install the Cowboy MCP plugin, connect your AI assistant, and start with a read-only audit. The SEO tools appear on their own once Rank Math is running.
- Install the plugin. In wp-admin, go to Plugins → Add New, search for "Cowboy MCP", and click Install then Activate. It is free on the WordPress.org plugin directory (opens in new tab) and needs WordPress 6.2+ and PHP 8.0+.
- Connect your AI. Open Settings → Cowboy MCP and follow the guided setup. See how to connect WordPress to Claude, how to connect WordPress to ChatGPT, or every supported AI app.
- Ask for something real. Start read-only — "audit my twenty most recent posts for SEO issues" — then let it fix them one post at a time, with a dry run on the first.
FAQ
Can an AI agent edit Rank Math SEO titles and meta descriptions?
Yes. With Cowboy MCP installed, an AI assistant such as Claude or ChatGPT can read and change a post's Rank Math SEO title, meta description, focus keywords, robots, canonical URL, Facebook and X/Twitter overrides and pillar-content flag. It writes to Rank Math's own fields, so the result shows up in the Rank Math panel exactly as if you had typed it.
Doesn't Rank Math have its own MCP server?
Rank Math registers about thirty abilities of its own through the WordPress Abilities API, for site-wide audits and fixes, settings, sitemaps, redirections, 404 logs, link reports and SEO scores, and since version 1.0.281 they reach AI apps through the official MCP Adapter plugin. None of them sets a single post's title, description or focus keyword; Cowboy MCP's tools do, and on WordPress 6.9 or newer Cowboy MCP also serves Rank Math's own abilities, so one connection reaches both.
Does it support several focus keywords?
Yes. On Rank Math the focus keyword field takes several comma-separated keywords, as Rank Math itself allows, and the first one is the primary keyword. The audit counts a post as having a focus keyword when at least one is set.
Can it change Rank Math's site-wide settings, sitemap or redirections?
No. The SEO tools work on per-post metadata only. Title and description templates, the sitemap, redirections, the 404 monitor, schema templates and Rank Math's modules stay in Rank Math's own screens, which keeps every change the agent makes attached to one post you can review and undo.
What if the AI noindexes the wrong page?
Undo it. Every SEO write is captured in the undo journal with the previous values, so a mistaken noindex, canonical URL or description rolls back from the Activity tab or by asking the agent to undo the change. Only the noindex directive is touched; other robots settings on the post are left as they were.
Is Rank Math MCP free?
Yes. The SEO tools are part of the free Cowboy MCP plugin on WordPress.org, with no paid tier and no account, and they work with the free version of Rank Math. You need an AI app that supports MCP, such as Claude or ChatGPT, on whichever plan that app requires for connectors.