Claude API Plugin for WordPress: What Actually Works
Is there an official Claude API plugin for WordPress?
No. Anthropic doesn't publish a WordPress plugin, and there's no first-party integration in the WordPress.org plugin directory that connects directly to the Claude API. What you'll find instead are third-party AI content plugins that let you plug in an API key for a provider — some support Claude, many are built OpenAI-first and bolt on Claude support later (or not at all), and quality varies a lot.
If you landed here because you want Claude writing drafts, answering support questions, or powering a chatbot on your WordPress site, you have two realistic paths: use a generic AI plugin that happens to support Claude's key format, or build a small custom integration yourself. This article covers both, plus the security trap most people fall into when doing either.
Option 1: generic AI plugins that accept a Claude key
A handful of WordPress AI plugins (content generators, chatbot widgets, SEO assistants) let you paste in an API key and pick "Anthropic" or "Claude" from a dropdown. Before installing one, check three things:
- Model support. Plugins get updated slowly. Many still default to an old Claude model name hardcoded in their settings, which will throw a 404 or model-not-found error until the plugin author patches it.
- Where the key lives. Some plugins store the raw API key in the WordPress options table (
wp_options), unencrypted. Anyone with database access, or a vulnerable plugin elsewhere on the same site, can read it. - Request handling. If the plugin makes the Claude API call from the visitor's browser instead of from your server, your API key is exposed in the page source. This is a real and common mistake in cheaply built plugins — always check the network tab in dev tools before trusting one.
If a plugin passes those three checks, it's a fine lightweight option for simple use cases like generating post excerpts or meta descriptions.
Option 2: build your own integration (more control, more work)
For anything beyond basic text generation — a support chatbot, a content assistant with your own prompts, streaming responses — you'll outgrow generic plugins fast. The standard pattern is:
- WordPress front end sends a request to a custom REST endpoint (not directly to Claude).
- Your server-side PHP code calls the Claude API with the key stored in
wp-config.phpor an environment variable. - The response comes back to the browser.
A minimal custom endpoint in a plugin or theme's functions.php:
add_action('rest_api_init', function () {
register_rest_route('mysite/v1', '/ask-claude', [
'methods' => 'POST',
'callback' => 'mysite_ask_claude',
'permission_callback' => '__return_true',
]);
});
function mysite_ask_claude($request) {
$prompt = sanitize_text_field($request->get_param('prompt'));
$response = wp_remote_post('https://api.anthropic.com/v1/messages', [
'headers' => [
'content-type' => 'application/json',
'x-api-key' => getenv('CLAUDE_API_KEY'),
'anthropic-version' => '2023-06-01',
],
'body' => json_encode([
'model' => 'claude-3-5-sonnet-20241022',
'max_tokens' => 1024,
'messages' => [['role' => 'user', 'content' => $prompt]],
]),
'timeout' => 30,
]);
return json_decode(wp_remote_retrieve_body($response));
}
This keeps the key server-side and gives you full control over the prompt, model, and output. The downside: you're now responsible for error handling, retries, rate limits, usage tracking, and rotating the key if it leaks — none of which WordPress gives you out of the box.
Why a lot of teams put an API layer in front of Claude first
If you're already building the custom-endpoint route above, it's worth asking whether you want to call Claude's raw API directly from your WordPress server at all. Two common pain points show up quickly:
- Multiple sites or environments. If you run Claude features across a main site, a staging environment, and maybe a client site, you end up copying the same key into multiple
wp-config.phpfiles — which is exactly how keys leak. - No visibility. Claude's raw API doesn't give you a dashboard showing which WordPress site made which request, how many tokens it used, or when a key was last active.
This is the problem SubToAPI solves: it sits between your WordPress server and Claude, issuing scoped application keys (sub_live_...) per site or per team member instead of one shared secret. You call it exactly like you'd call Claude:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Write a 2-sentence product description"}]
}'
Swap that endpoint into the PHP snippet above and you get usage metadata per key, per-site keys you can revoke independently, and support for streaming and tool use if you need them later — without rewriting your WordPress code. See the quickstart for setup and the messages docs for the full request format.
Practical recommendations
- For simple, occasional tasks (meta descriptions, excerpt generation), a vetted generic plugin is fine — just verify key storage and request routing first.
- For anything customer-facing or high-volume (chat widgets, content pipelines), build a thin custom endpoint and keep the API key server-side, never in a browser request.
- If you manage more than one WordPress property or more than one person needs access, use scoped keys instead of sharing one Claude key across environments — it makes revoking access after a staff change or a leak trivial.
- Start with a free trial via /signup if you want per-site keys and usage tracking without building that layer yourself, and check /pricing for plan details.
Questions
Does Anthropic make an official WordPress plugin for Claude? No. There's no first-party Claude plugin in the WordPress.org directory. Available options are third-party plugins with partial Claude support, or a custom integration you build yourself.
Is it safe to paste my Claude API key into a WordPress plugin's settings page? Only if you've verified the plugin stores the key server-side and makes API calls from your server, not the visitor's browser. Check your browser's network tab for exposed keys before trusting any plugin with a live key.
What's the easiest way to add Claude to a custom WordPress feature? Create a custom REST endpoint in PHP that calls the Claude API (or a proxy like SubToAPI) server-side, and have your front-end JavaScript call that endpoint instead of the AI API directly.