WordPress and AI – WP AI Client, Connectors, MCP Adapter, and Practical Plugins
Published: April 15, 2026 · Author: Marcin Szewczyk-Wilgan
WordPress 7.0 ships with a native AI infrastructure layer for the first time in the platform's history. This is not just a chatbot feature or an AI writing assistant bolted onto the admin panel – it is a provider-agnostic abstraction layer that lets any plugin access AI capabilities through a single API, with the underlying AI provider configurable once by the site administrator. Alongside the core infrastructure, a rich ecosystem of third-party AI plugins has matured. This article covers the complete WordPress AI landscape: from core architecture through practical plugins to security considerations and cost management.
WP AI Client – The Core Architecture
WP AI Client is WordPress's provider-agnostic AI abstraction layer, introduced in WordPress 7.0. It wraps the PHP AI Client SDK (the wordpress/php-ai-client Composer package) in WordPress-specific error handling and configuration management.
wp_ai_client_prompt(); which AI model executes the prompt is determined by the site's connector configuration. A plugin built for WP AI Client works with OpenAI, Anthropic Claude, Google Gemini, or a local Ollama instance without any code changes.WP_AI_Client_Prompt_Builder instance that uses a fluent interface:$result = wp_ai_client_prompt()
->using_temperature(0.3)
->using_model_preference('claude-sonnet-4-5', 'gemini-3-pro-preview', 'gpt-5.1')
->generate_text('Write a 50-word excerpt for: ' . $post_title);The
using_model_preference() method accepts an ordered list of preferred models; WP AI Client uses the first one supported by the active connector.WP_Error objects for failures – consistent with WordPress conventions. Always check is_wp_error($result) before using the response. Common errors: no connector configured, API key invalid or expired, rate limit exceeded, or model not available on the active connector.getenv('OPENAI_API_KEY') in a custom connector configuration. Keys stored in the database are exposed by any database dump.Connectors API
The Connectors API is the configuration layer that tells WP AI Client which AI provider to use and how to authenticate. Connectors are managed in Settings → Connectors in the WordPress admin.
OpenAI, Anthropic, Google
WordPress 7.0 ships with official connectors for the three major AI providers. The OpenAI connector provides access to GPT models, DALL-E image generation, and TTS. The Anthropic connector covers the Claude model family. The Google connector wraps Gemini with access to web search grounding – letting prompts retrieve current information from the web as part of generation.
OpenRouter, Ollama, Mistral
The connector ecosystem extends beyond official providers. OpenRouter provides access to dozens of models from multiple providers through a single API key. Ollama enables running open-source models locally on your own server – no data leaves your infrastructure. Mistral gives access to European AI models with GDPR-friendly data residency options.
Opt-in core AI features
WordPress 7.0 includes opt-in AI features tied to WP AI Client: automatic excerpt generation, alt text suggestions for images, content summaries, and AI-assisted image generation. These are disabled by default and enabled individually in Settings → AI Experiments. They use the active connector and count against your API usage.
Bring your own API key
WP AI Client uses a BYOK (bring-your-own-key) model – you pay your AI provider directly. For a typical content blog, AI usage costs a few USD per month. High-volume uses (chatbots, bulk translation, automated content generation) scale with request volume. Ollama eliminates API costs for deployments that can run models locally.
MCP Adapter and WordPress Playground MCP
Beyond using AI within WordPress, WordPress 7.0 also enables AI systems to use WordPress as a tool.
@wp-playground/mcp package provides an MCP server for WordPress Playground – a browser-based WordPress environment. This lets AI assistants spin up ephemeral WordPress instances for testing, demonstration, and development without requiring a live site. Particularly useful for plugin and theme development workflows that need a clean WordPress environment on demand.@wordpress/abilities, @wordpress/core-abilities) defines what AI features are available in a given context. It is the mechanism by which AI features in the block editor – writing suggestions, image alt text, content summaries – are registered, discovered, and invoked. Plugins can register custom abilities that appear in the editor's AI toolbar.Practical AI Plugins for WordPress
The WP AI Client ecosystem is new. A rich set of third-party AI plugins has been in production for years and covers most practical use cases without requiring WordPress 7.0.
AI in WordPress Development
Beyond site-level AI features, AI tools have transformed WordPress development workflows.
AI-assisted development
AI coding assistants that understand WordPress conventions – hooks, filters, WP_Query, REST API, block editor patterns – dramatically accelerate plugin and theme development. Connected to WordPress via the MCP Adapter, Claude Code can read site configuration, query content, and run WP-CLI commands as part of development and debugging workflows.
Multi-site management automation
Combining WP-CLI with AI scripting enables sophisticated multi-site management: generating site audits across a hosting fleet, identifying outdated plugins, producing migration plans, and automating routine maintenance tasks. AI processes WP-CLI output and generates structured reports or action scripts.
AI-assisted debugging
Feeding WordPress error logs, PHP error output, and database slow query logs to an AI assistant provides faster root cause identification than manual log analysis. AI assistants are particularly effective at correlating PHP stack traces with plugin interactions and suggesting targeted fixes.
Security and quality checks
AI code review catches WordPress-specific security patterns: missing nonce verification, unescaped output, unsanitized inputs, and SQL injection vectors. Useful as a first-pass review layer before human code review. Does not replace human security review but catches common classes of mistakes reliably.
Security Considerations
AI features in WordPress introduce specific security risks that standard WordPress hardening does not fully address. See the dedicated AI Security in WordPress article for full coverage. Key points:
Summary
WordPress 7.0's native AI infrastructure marks a maturation point for AI in the WordPress ecosystem. The provider-agnostic WP AI Client architecture is a thoughtful design: it separates the "what AI does" (plugin functionality) from "which AI does it" (connector configuration), making AI features portable across providers and future-proof against the rapid changes in the AI landscape. For site operators, the practical question is not whether to adopt AI features but which combination of native WP AI Client capabilities and established third-party plugins best fits the site's specific use cases. The security considerations – API key storage, data residency, AI-generated code review – are real but manageable with standard professional practices.


