For AI to succeed in WordPress, it will require the innovation of the plugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party and theme developer community. If you are a developer, even if you barely know how AI works, then this article is for you. Check out the AI Building Blocks for WordPress post if you need an introduction to the Core Core is the set of software required to run WordPress. The Core Development Team builds WordPress. AI efforts.
Let’s break down the various AI tools available to you and provide little nudges of ideas as to what sort of things can be done with each tool.
Abilities API A core WordPress API (introduced in 6.9) that creates a central registry of capabilities, making WordPress functions discoverable and accessible to AI agents, automation tools, and developers. Transforms WordPress from isolated functions into a unified system.
Now in WordPress 6.9!
The Abilities API brings a new primitive to WordPress for defined functions that can work in multiple contexts. Abilities are connected to AI, but not limited to AI. There are two great articles as introductions to the Abilities API:
When it comes to AI, there are two main ways Abilities play an important role.
First, simply creating Abilities! Abilities are, by definition, public functions intended for public use. As such, developers are encouraged to use others’ Abilities. Since Abilities have defined input and output schema, they can also be passed to AI models as Function Declarations (so the AI can request to call Abilities).
Second, Abilities can integrate with other systems such as the MCP Adapter Translates WordPress abilities into Model Context Protocol format, allowing AI assistants like Claude and ChatGPT to discover and invoke WordPress capabilities as tools, resources, and prompts. and (coming soon) the Command Palette. Simply add the following meta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. to your ability A registered, self-documenting unit of WordPress functionality that can be discovered and invoked through multiple contexts (REST API, Command Palette, MCP). Includes authorization and input/output specifications. to connect it to the MCP Adapter:
wp_register_ability('my/ability', array(
// typical parameters like category and input go here...
'meta' => array(
'mcp' => array(
'public' => true,
'type' => 'tool' // can also be 'resource' or 'prompt'
)
)
));
Doing this opens the Ability up to external AI models via the MCP server Exposes tools, resources, and prompts according to Model Context Protocol specification. WordPress can run multiple MCP servers with different configurations.. As more Abilities are added with this enabled, the more capable the MCP server becomes!
WP AI Client SDK
Proposed to go into WordPress 7.0!
At the core of communicating with AI is prompts, and every AI Provider An AI service offering models for generation, embeddings, or other capabilities (e.g., Anthropic, Google, OpenAI). has its own API An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. for communicating via prompts. The WP AI Client provides a single, intuitive interface for constructing prompts and sending them to any registered Provider.
$text = AI_Client::prompt( 'Write a 2-verse poem about PHP.' )->generate_text();
It really is as simple as that. Under the hood, the WP AI Client is a wrapper for the PHP AI Client, an open-source, framework agnostic PHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php. package also developed by WordPress. It is separated into two functional parts:
1. Providers & Models
This has to do with integrating the client with specific providers (e.g. Anthropic) and their models (e.g. Claude Sonnet 4.5). This will largely be left up to experimenting developers and hosts. They register their Provider server with the client, and then folks are able to run prompts. This is the more technical side of things which most folks won’t have to worry about.
2. Implementation
Implementation is constructing and running prompts. This is literally anything that you could think to do with an AI. As you see in the example above, you call AI_Client::prompt() to start building a prompt. This returns a builder, which supports modifying the prompt in many ways. This includes, but is not limited to:
- Generating multiple candidates at once
- Providing a chat history for conversations
- Adjusting model parameters like temperature (randomness)
- Including system instructions to have the AI act in certain, specific ways
- Sending and receiving multiple modalities such as text, images, audio, and video
- Creating Function Definitions and handling Function Calls to and from the model
$poems = AI_Client::prompt( 'Write a 2-verse poem about PHP.' )
->using_system_instruction( 'You are a famous poet from the 17th century.' )
->using_temperature( 0.8 )
->generate_texts(4);
As with these examples, the prompts themselves can get progressively more complex, handling everything from a simple one-off prompt to an agentic, multi-modal workflow.
The primary goal here is to experiment and make amazing, AI-powered features. While the most popular AI-powered feature is the chat prompt, it’s encouraged to think of features that integrate naturally into WordPress — and aren’t even obviously AI. Imagine…
- Selecting a paragraph block Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. in the Block Editor and pressing a “View alternatives” button that generates multiple alternative rephrase options
- Clicking a “generate” button that takes a post’s content and generates a featured image A featured image is the main image used on your blog archive page and is pulled when the post or page is shared on social media. The image can be used to display in widget areas on your site or in a summary list of posts.
- Providing powerful editing tools in the Media Library such as adding/removing objects from an image
- Having an “Optimize SEO” that takes a few keywords, reviews the post’s content, and then leaves comments in blocks for ways wording can be improved to better target keywords
- Generate a natural sounding audio version of a blog post at the click of a button
All of these sorts of features would’ve been very complicated to build without AI. But with AI, some of these are even trivial to create. They’re the sort of features that feel like magic to end users, empowering them to feel like they can do new things right within WordPress.
Setting up the Client
Presently, it’s necessary to either add the wordpress/wp-ai-client composer package or, more easily, install the AI Experiments plugin (recommended). Once installed, you can pick a Provider, connect using your API key, and begin using the client in your own plugin code.
Keep in mind that the goal is for hosts to ultimately include the Providers. This means it’s recommended at this time to focus on what you can create, rather than thinking of how your users can connect to their Provider. Most users are non-technical and this is simply too much of a lift, which is why the responsibility to include a Provider is on hosts.
Model selection & compatibility checking
For experimentation, you can specify models or model preferences (which falls back on another model if not available). The goal, however, is to not specify a model at all. Under the hood, when the prompt is finished and the generate method is called, the client will break down the model into its parts (e.g. is text, wants multiple candidates, wants text in return) and finds a registered model that fits the need. Doing it this way makes your features more adaptable to the environment and across different hosts.
It’s possible, and encouraged, to check if a prompt has a corresponding model before attempting to run the prompt. This is useful for making sure your plugin still runs properly on environments that don’t have a registered Provider, or for more complicated prompts that the given Provider may not support.
Here’s an example of checking:
$prompt = AI_Client::prompt( 'Write a 2-verse poem about PHP.' );
if ( $prompt->is_supported_for_text_generation() ) {
// only show the button if it's supported
echo '<button>Write poem</button>';
}
Again, the intent here is to adaptively include AI-powered features in your plugins as the environment supports it.
MCP Adapter
For models outside of WordPress to interact effectively with WordPress, the MCP Adapter fills that role. It accomplishes this in two ways:
Default MCP Server
Out of the box the MCP Adapter creates a default MCP Server composed of Abilities which have opted in, and turns them into MCP Tools, Resources, and Prompts for AI usage. There’s complexity with managing the number of MCP Tools as well, which the default server also handles.
Customer MCP Servers
It’s also possible to register your own MCP Server, adding any of your own components, including Abilities. This route is typically recommended for advanced use cases such as product plugins and services that want to isolate their MCP Components and have tighter control over the server.
What’s Next
This is just the beginning! AI is going to continue to improve and develop over many years. There are more protocols such as WebMCP and AI browsers that are worth watching and iterating on. As these tools are used to build an AI-powered WordPress, the experience will guide future improvements. The AI Team is committed to helping everyone in WordPress succeed with AI, and new people join the #core-ai channel regularly. It’s exciting!
The key to making this all work is a snowball effect between WordPress hosts and developers. As developers create AI-powered features, hosts will be enticed to provide AI as part of their platform. As hosts do this, the accessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility) of AI will broaden, further encouraging developers to create and innovate more. This symbiosis is what will truly make AI a fundamental part of WordPress.
Keep an eye out for further posts and updates, especially aimed at developers. Everyone is welcome to join the Make WordPress #core-ai channel and contribute, but even more than contributors, the biggest need is developers out there using these tools and pushing them to their limit. This is a key time for developers to use these tools, push them to their limits, and report back on what’s needed to go even further. Do what you already do: dream big and make amazing things!
Props to @annezazu, @jeffpaul, and @isotropic for the pre-publish review
You must be logged in to post a comment.