I had a client last year—big WooCommerce store—who wanted an automated way to generate SEO-friendly meta descriptions for their 50,000 products. My first instinct was to just wire up a direct wp_remote_post call to the OpenAI API. It seemed simple enough. I hardcoded the model, setup a prompt, and it worked… for exactly two weeks. Then the client wanted to test Claude because of better reasoning, and my “simple” implementation turned into a mess of if/else statements and brittle JSON parsing. Total nightmare. Trust me on this: direct API calls are the fast lane to technical debt when it comes to AI for WordPress Developers.
The core problem isn’t the AI; it’s how we’ve been shoving it into WordPress. We’ve been treating AI like a third-party widget rather than a core part of the stack. But with WordPress 6.9 and 7.0 on the horizon, the ground is shifting. We’re finally getting a standardized way to talk to these models without rewriting our logic every time a provider updates their documentation.
Enter the Abilities API
In WordPress 6.9, we saw the introduction of the Abilities API. Think of “Abilities” as a new primitive for defining functions that are public-facing and, more importantly, discoverable by AI models. Instead of manually explaining to an LLM what your custom function does, you register it as an Ability with a defined schema. This builds on concepts I saw in the original Core AI roadmap. Here is how you might register one using the standard prefix:
wp_register_ability( 'bbioon/get-product-data', array(
'description' => 'Retrieves specific product metrics for SEO analysis.',
'input' => array(
'type' => 'object',
'properties' => array(
'product_id' => array( 'type' => 'integer' ),
),
),
'meta' => array(
'mcp' => array(
'public' => true,
'type' => 'tool',
),
),
) );
By doing this, you’re not just writing a function; you’re creating a “tool” that an AI can actually request to use. The mcp meta key is the kicker here—it allows external AI models via the Model Context Protocol (MCP) to interact with your site’s data securely. No more hacky endpoints.
Standardizing Prompts with the WP AI Client
Coming in WordPress 7.0, the WP AI Client SDK is the real AI for WordPress Developers game-changer. It’s a wrapper for the PHP AI Client that provides a single interface for prompts. If a host supports Anthropic and another supports OpenAI, your code doesn’t change. You just call the client and let WordPress handle the routing.
Here’s the right way to handle a generation task without worrying about which model is under the hood:
$bbioon_prompt = AI_Client::prompt( 'Analyze this product content and suggest three keywords.' )
->using_system_instruction( 'You are a professional SEO consultant.' )
->using_temperature( 0.7 );
if ( $bbioon_prompt->is_supported_for_text_generation() ) {
$bbioon_result = $bbioon_prompt->generate_text();
// Do something useful with the result.
}
The beauty of this approach is adaptability. You can check for support before even rendering a UI element. If the environment doesn’t have a registered provider, you don’t show the “Generate SEO” button. It’s defensive programming for the AI era. Period.
Why This Actually Matters
We need to stop thinking about AI as just a chat window. The real power is in the “silent” features—things like generating alt text for images in the media library or offering rephrase suggestions inside a paragraph block. These tools make the user feel empowered, not overwhelmed. By using the MCP Adapter and the AI Client, you’re building features that are future-proof. When a new, faster model comes out next month, you won’t have to touch your code.
Look, this stuff gets complicated fast. If you’re tired of debugging someone else’s messy API integrations and just want your site to work with the latest standards, drop my team a line. We’ve probably seen it before.
The symbiosis between hosts and developers is what will make this work. As we build better features, hosts will be forced to provide better AI infrastructure. It’s a win for everyone. So, are you going to keep hardcoding your wp_remote_post calls, or are you ready to build something that actually lasts?
Leave a Reply