Building WordPress Abilities API Extensions for Third-Party Plugins (SEO Edition)
In my previous post about internal linking, I promised to show you how to build WordPress Abilities API extensions for other people’s plugins.
Today, I’m delivering on that promise.
We’re staying in the SEO lane—updating meta titles, descriptions, focus keywords, image alt text, and Open Graph settings. You know. All the tedious stuff that makes SEO optimization feel like a part-time job nobody applied for.
To manage these settings, you need an SEO plugin. I’m using Rank Math.
Why Rank Math? Honestly? Because it’s what I use on my own site. No fancy reason—I’m showing you real projects I actually need. A bit of selfishness, sure. But that’s the deal I made with you.
.
.
.
The Problem That’s Been Nagging Me
Here’s my situation. (And I bet—I really bet—you’re in the same boat.)
I’ve been publishing newsletters for 28 consecutive weeks now.
Twenty-eight weeks of hitting “publish” and hoping—really hoping—the SEO gods would smile upon me. Twenty-eight weeks of telling myself I’d go back and optimize everything “later.”
You know how that goes.
The whole time, I believed good content would naturally attract readers. And to some extent? That’s true. But optimizing for SEO amplifies everything.
Here’s the thing:
Since I never focused on SEO before, going back to optimize all those posts is a mountain of work. The kind of mountain that makes you want to lie down, stare at the ceiling, and pretend the problem doesn’t exist.
(Sound familiar?)
Sure, I could subscribe to Rank Math Premium and use their bulk edit feature.
But then WordPress 6.9 introduced the WordPress Abilities API.
And suddenly—suddenly—we can hook our WordPress sites directly to AI agents via MCP.
So here’s what I’m building: a Rank Math extension that exposes SEO functionality through the WordPress Abilities API. Mass updates. AI-powered. Hands-free. The workflow is nearly identical to the internal linking plugin I built before. A few tweaks here and there—specific adjustments for extending someone else’s plugin.
Let me walk you through it.
.
.
.
Step 1: Brainstorming for Requirements
Every vibe coding project starts the same way for me: brainstorming requirements.
I use Claude web for this. Something about it works better for the back-and-forth Q&A sessions—the clarifying questions, the drilling down into what I actually want.
I start with a rough description of the plugin I need, then use my go-to prompt:

PROMPT: Requirements for WordPress Abilities API SEO Extension
The Rank math WordPress plugin doesn't have REST API. Instead of building our own REST API, I want to use the latest abilities API from WordPress to create abilities for the Rank Math WordPress plugin. We are not building it on top of the Rank Math plugin. This is a standalone plugin. However, it does need the Rank Math plugin in order for it to work.
The abilities I'm thinking of are:
- Search posts, custom post types, pages (default: post) by keywords, categories, tags, custom taxonomies, id, author, date range, etc
- get post, custom post type, page (default: post) by id. This would retrieve the full content of the post including title, content, excerpt, featured image, taxonomies, author info, as well as Rank Math SEO data like focus keyword, meta title, meta description, and any other relevant SEO fields that Rank Math manages for that post.
- update the rank math seo data for a given post, custom post type, or page by id. This would include updating fields like focus keyword, meta title, meta description, schema settings, social media metadata, and any other SEO-related fields that Rank Math handles.
The main Rank Math plugin is located at: /Users/nathanonn/LocalSites/abilities-api/app/public/wp-content/plugins/seo-by-rank-math
You can read the codebase to understand how the main Rank Math plugin works.
Please use the "wp-abilities-api" skill to help you with any WordPress Abilities API related tasks.
The idea is to create a separate plugin that exposes a REST API for interacting with Rank Math SEO data using LLM via MCP server.
I want you to help me brainstorm for the requirements of this plugin. Focus on business logic and rules, user stories, and acceptance criteria. No need to include technical implementation details.
The Rank math WordPress plugin doesn't have REST API. Instead of building our own REST API, I want to use the latest abilities API from WordPress to create abilities for the Rank Math WordPress plugin. We are not building it on top of the Rank Math plugin. This is a standalone plugin. However, it does need the Rank Math plugin in order for it to work.
The abilities I'm thinking of are:
- Search posts, custom post types, pages (default: post) by keywords, categories, tags, custom taxonomies, id, author, date range, etc
- get post, custom post type, page (default: post) by id. This would retrieve the full content of the post including title, content, excerpt, featured image, taxonomies, author info, as well as Rank Math SEO data like focus keyword, meta title, meta description, and any other relevant SEO fields that Rank Math manages for that post.
- update the rank math seo data for a given post, custom post type, or page by id. This would include updating fields like focus keyword, meta title, meta description, schema settings, social media metadata, and any other SEO-related fields that Rank Math handles.
The main Rank Math plugin is located at: /Users/nathanonn/LocalSites/abilities-api/app/public/wp-content/plugins/seo-by-rank-math
You can read the codebase to understand how the main Rank Math plugin works.
Please use the "wp-abilities-api" skill to help you with any WordPress Abilities API related tasks.
The idea is to create a separate plugin that exposes a REST API for interacting with Rank Math SEO data using LLM via MCP server.
I want you to help me brainstorm for the requirements of this plugin. Focus on business logic and rules, user stories, and acceptance criteria. No need to include technical implementation details.
A few rounds of Q&A later, Claude compiles the full requirements:

You can read the full requirements document here.
(I’m skipping the detailed brainstorming walkthrough this time. If you want the step-by-step breakdown, check my previous post—I covered the entire process there.)
.
.
.
Step 2: Project Folder Setup
Nothing glamorous here—but necessary.

I set up the project folder and install the wp-abilities-api skill.
I also installed three additional skills (optional, but useful):
- build-insights-logger: Captures insights during the build so Claude Code learns from the process and avoids repeating mistakes
- skill-creator: Creates new skills on the fly if needed
- mcp-builder: In case I need to spin up an MCP server quickly
After that, I dropped the requirements into the notes/ folder and created a blank main plugin file (wp-abilities-seo-extension.php).
Ready to build.
.
.
.
Step 3: Build the Plugin with One Shot Prompt
Everything’s in place. Time to ask Claude Code to build the entire plugin.
One shot.
Yes, one prompt.
Sounds ambitious—maybe even reckless—but it works because the requirements are comprehensive and the wp-abilities-api skill handles the heavy lifting.

Here’s the exact prompt:
Based on the requirements at @notes/requirements.md, please help me build the plugin from scratch. Please use the "wp-abilities-api" skill to help you with any WordPress Abilities API related tasks. Please use the "build-insights-logger" skill to automatically log meaningful insights, discoveries, and decisions during coding session. The main Rank Math plugin is located at: /Users/nathanonn/Studio/wp-test/wp-content/plugins/seo-by-rank-math You can read the codebase to understand how the main Rank Math plugin works.
Short prompt.
No novel required.
Why? Because everything Claude needs lives in the requirements document and the skills. The only addition: the Rank Math plugin location. Claude needs to read and understand the codebase of the plugin we’re extending.
That’s the critical piece for building third-party extensions. Point Claude at the source code.
I’m using Claude Code in Plan Mode with Opus 4.5. This lets it explore, research, and strategize before writing a single line of code.

Claude fires up two explore agents in parallel:
- One reads the project structure and requirements
- One dives into the Rank Math codebase

Then it consults the wp-abilities-api skill to understand proper registration patterns:

At this point, Opus 4.5 has a complete picture:
- The project state (empty plugin)
- Rank Math’s meta keys and helper functions
- WordPress Abilities API registration patterns
Time to plan.

The plan is comprehensive. Detailed architecture. Clear implementation phases. All thanks to Opus 4.5’s capabilities combined with thorough requirements.


I agreed to the plan. Implementation begins.

(The full build process is Claude generating codes while I drink coffee. Nothing riveting to watch.)
This is the part where I’d normally tell you to go make a sandwich.
But you won’t need to.
Less than 6 minutes later: Opus 4.5 completes the build.
Six minutes.
For a complete WordPress Abilities API plugin.
Stay with me here.

21 PHP files. Core infrastructure. Provider layer. Services. Error handling. All 10 abilities implemented.
Because I included the build-insights-logger skill in my prompt, Claude captured every key decision and discovery during development:

These insights become documentation.
Learning material for the next build.
.
.
.
Step 4: Test the Plugin with Claude Code
Build complete.
But before we pop any champagne (or, you know, instant coffee)—we test.

Here’s my testing prompt:
Please activate & test out the plugin:
- Test all the abilities via REST API. Example endpoint:
`GET /wp-json/wp-abilities/v1/seo-abilities/get-seo-meta/run?input[post_id]=1`
- Verify that the MCP discovery shows all 10 abilities correctly.
- Test error handling by providing invalid post IDs and ensuring that the plugin responds appropriately.
Please use the "wp-abilities-api" skill to help you with any WordPress Abilities API related tasks.
Please use the "build-insights-logger" skill to automatically log meaningful insights, discoveries, and decisions during coding session.
You have access to WP-CLI commands to help you with the development and troubleshooting.
Three focus areas:
- Test abilities via REST API
- Verify MCP discovery shows all 10 abilities
- Test error handling with invalid inputs
Claude runs through the tests:

(Again, nothing thrilling here. Claude does the work. I watch with my coffee.)
Test results come in:

All 10 abilities working. MCP discovery correct. Error handling validated.
The summary shows exactly what each ability does and any notable behaviors.
.
.
.
Step 5: Use Test Results for Improvements
Tests passed.
But—and this is important—passing tests doesn’t mean perfect code.
I asked Opus 4.5 to analyze the test results and suggest improvements:

Based on your test results, identify the areas that may need improvement or further testing, and come up with a plan to address them.
Claude explores the codebase again, this time hunting for edge cases and potential issues:

It found several areas to improve:
- Permission callback consistency
- Image validation for orphaned images (HTML references to non-existent attachments)
- Output schema enhancements
Claude even asked a clarifying question about handling orphaned images. (I chose the recommended option: add new fields to distinguish orphaned images while preserving the original reference ID for debugging.)
Improvements implemented:

The changes:
- Permission Callbacks: Changed 7 abilities from
check_edit_post_permissiontocheck_edit_posts_permissionfor better error handling - Image Validation: Added attachment existence validation, new
is_orphanedandreferenced_idfields for orphaned images - Output Schema: Added
images_orphanedcount to theget_post_imagesreturn data
All verified with fresh tests. 29 orphaned images detected correctly on my site. The schema updates reflected in MCP discovery.
.
.
.
Step 6: Put the Plugin to Work
Everything’s built and tested.
Now comes the fun part—actually using it.
The process mirrors what we did with the internal links plugin. First, install the MCP Adapter plugin into your WordPress site.

(You can download the MCP Adapter from their GitHub releases page.)
With the adapter active, I asked Claude what abilities my WordPress site has:

All 10 abilities visible. Three categories. Ready to go.
Now for the moment of truth—the reason I built this whole thing in the first place.
I asked Claude to optimize SEO for a specific post:

I want to optimize my post for SEO (ID: 1557). First, scan the post to understand its content and current SEO setup. Then, propose improvements that fall within your abilities.
Claude immediately starts gathering data. Multiple abilities firing in parallel:

Four abilities. One request. All the SEO data I need.
Here’s what Claude found—and honestly, it stings a little to share this:

The diagnosis:
- SEO Score: 33/100 (Poor)
- Title: 82 characters (max recommended: 60)
- Description: 202 characters (max: 160)
- Keyword in title: Missing
- Social meta: Completely empty
- Images: 3 total, 0 with alt text
Ouch.
But also? Exactly why I built this plugin.
Claude analyzed the issues and proposed a complete optimization plan:

The plan covers everything: shorter title with keyword, trimmed description, Facebook/Twitter metadata, and contextual alt text for all three images.
Expected result: SEO score from 33 → 80+.
I approved. Claude executed:


Interesting note: the bulk image update failed, so Claude adapted and updated each image individually. Problem-solving on the fly.

Results summary:
| Metric | Before | After |
|---|---|---|
| SEO Title | 82 chars (too long, no keyword) | 58 chars ✅ with keyword |
| Meta Description | 202 chars (too long, no keyword) | 153 chars ✅ with keyword |
| Social Meta | Empty | Facebook & Twitter configured ✅ |
| Images with Alt Text | 0/3 | 3/3 ✅ |
All 5 SEO tests now pass. Previously: 1 pass, 3 warnings, 1 fail.
Let me verify in the WordPress admin:

SEO score: 71/100.
Not quite the 80+ the plan aimed for—but jumping from 33 to 71? I’ll take it.
Especially considering I did nothing except approve a plan.

The snippet preview shows proper character counts. Title at 59/60. Description at 152/160. Both in the green zone.
And the images:



All three images now have descriptive, contextual alt text. Claude understood what each image showed and wrote appropriate descriptions.
.
.
.
Try It Yourself
Want to run this on your own site?
- Download the plugin: https://github.com/nathanonn/wp-abilities-seo-extension/releases/download/v1.0.0/wp-abilities-seo-extension-latest.zip
- Install the MCP Adapter: Grab it from the GitHub releases page
- Follow the setup instructions: Check the README for configuration details
- Connect Claude Code (or any MCP-compatible AI agent)
- Start optimizing
If you want to extend the plugin further—maybe add content analysis, FAQ generation, or schema markup—fork the repo:
github.com/nathanonn/wp-abilities-seo-extension
.
.
.
What We Built (And What It Means)
Let’s zoom out for a second.
In under 6 minutes of build time, we created a WordPress plugin that:
- Exposes 10 SEO abilities through the WordPress Abilities API
- Integrates with Rank Math (with architecture ready for Yoast, AIOSEO, etc.)
- Lets AI agents read, analyze, and update SEO settings
- Handles bulk operations for mass optimization
- Manages image alt text across your entire content library
The real unlock?
Your WordPress site now speaks MCP.
Any AI agent—Claude Code, custom bots, automation pipelines—can now optimize your SEO programmatically. No clicking through admin panels. No manual data entry. No tedious bulk editing. You describe what you want. The AI executes using the abilities you’ve exposed through the WordPress Abilities API.
This is the promise of WordPress 6.9’s Abilities API.
And we’re just scratching the surface.
.
.
.
What’s Next?
Two plugins down. Both solving real problems I face on my own site.
The pattern works:
- Brainstorm requirements with Claude
- Set up project with the right skills
- One-shot build with comprehensive prompt
- Test and iterate
- Deploy and use
For extending third-party plugins, add one step: point Claude at the source code.
Remember those 28 weeks of newsletters I mentioned at the start? The mountain of SEO work that made me want to lie down and stare at the ceiling?
It’s not a mountain anymore.
It’s a checklist. And I have an AI agent with a pen.
What tedious WordPress task are you going to automate next?
The WordPress Abilities API is waiting.
Go build something.
Leave a Comment