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.

Provider agnosticismThe core principle of WP AI Client is that plugin code does not reference a specific AI provider. A plugin calls 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()The primary API function. Returns a 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.
Error handlingUnlike the underlying PHP AI Client SDK (which throws exceptions), WP AI Client returns 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.
API key securityWP AI Client masks API keys in the Settings → Connectors admin screen but stores them in the WordPress database in plain text. For production sites, the recommended approach is to store keys in server environment variables and reference them with 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.

Official connectors

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.

Community connectors

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.

AI Experiments

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.

Cost model

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.

MCP AdapterThe MCP Adapter turns a WordPress installation into an MCP (Model Context Protocol) server. AI coding assistants that support MCP – Claude Code, Cursor, VS Code with Copilot, and others – can connect to your WordPress site and interact with it directly: querying posts and user data, running WP-CLI commands, executing REST API calls, and reading site configuration. This makes WordPress a native tool in AI-assisted development workflows.
WordPress Playground MCPThe @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.
Abilities APIThe JavaScript Abilities API (@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 Engine (Jordy Meow)The most feature-complete AI plugin for WordPress prior to WP AI Client. Provides chatbot, content generator, image generator, template-based text generation, and fine-tuning workflows. Supports OpenAI, Anthropic, and other providers independently. Note: CVE-2025-11749 affected AI Engine – always run the current version. The plugin is actively maintained with fast security response.
Jetpack AI AssistantAutomattic's integrated AI assistant for the block editor, available through Jetpack. Provides writing assistance, tone adjustment, translation, and summarization directly in the editor interface. Uses Automattic's own AI infrastructure – no API key configuration required, but usage is billed through Jetpack's subscription model rather than directly to your AI provider.
Rank Math Content AIAI writing assistance integrated into Rank Math SEO's workflow. Generates SEO-optimized content with keyword targeting built into the generation prompt. Also includes an llms.txt generator – automatically creates the /llms.txt file for AI crawler guidance. The SEO context-awareness makes this more useful for content teams than a general-purpose AI writing plugin.
TranslatePressMultilingual plugin with AI-assisted translation supporting 130+ languages. Translates page content, custom post types, WooCommerce product data, and theme strings. AI translation is used for initial draft translation; editors can then refine through the visual translation interface. More cost-effective than human translation for high-volume multilingual sites.
TidioLive chat and AI chatbot platform with deep WooCommerce integration. The AI layer handles common customer questions (order status, shipping, returns policy) automatically, escalating to human agents when confidence is low. The WooCommerce integration lets the chatbot answer product-specific questions by querying the store's catalog. Works independently of WP AI Client.
Elementor AIAI features built into the Elementor page builder: text generation, image generation, and code generation (custom CSS/JS). Elementor AI maintains its own provider integrations independent of WP AI Client. Useful for Elementor-based sites; less relevant if you use the native block editor.

AI in WordPress Development

Beyond site-level AI features, AI tools have transformed WordPress development workflows.

Claude Code / Cursor

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.

WP-CLI + AI

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.

Diagnostics

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.

Code review

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:

API key exposureStore API keys in environment variables, not in the WordPress database. Any SQL injection vulnerability or database backup leak also exposes keys stored in wp_options. A compromised API key can incur significant costs or be used to access your AI provider account.
AI-generated codeApproximately 45% of AI-generated code for web applications contains security vulnerabilities according to 2025 research. Code generated by AI assistants for WordPress must be reviewed for nonce verification, sanitization, escaping, and capability checks before deployment.
Data sent to AI providersAny content sent to cloud AI providers (OpenAI, Anthropic, Google) for processing is subject to those providers' data handling policies. For sites processing personal data under GDPR, verify that your AI provider offers a Data Processing Agreement and that data residency requirements are met. Local Ollama deployments eliminate this concern.
Supply chain riskAI plugins interact with external APIs and are actively targeted by attackers seeking to compromise the API key storage or the AI processing pipeline. Apply the same supply chain diligence to AI plugins as to any other high-permission plugin: vet the developer, track security disclosures, and update promptly.

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.

Need Help with WordPress?

If you have questions after reading the articles or need support – we are at your disposal. No commitments, no marketing jargon – a concrete proposal after a brief conversation.

Phone

+48 608 271 665

Mon–Fri, 8:00–16:00 CET

E-mail

contact@weboptimo.pl

We respond within 24h

Company

WebOptimo

VAT ID: PL6391758393