← Blog

Claude API Plugin for WordPress: What Actually Works

2026-10-14 · 5 min read · SubToAPI Team

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:

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:

  1. WordPress front end sends a request to a custom REST endpoint (not directly to Claude).
  2. Your server-side PHP code calls the Claude API with the key stored in wp-config.php or an environment variable.
  3. 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:

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

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.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →