WordPress 7.0 added a built-in way to connect your site to an AI provider like Anthropic (Claude), Google (Gemini) or OpenAI (ChatGPT). Once a provider is connected, plugins can use it for things like generating alt text, summarizing posts or suggesting titles, without each plugin asking you for its own API key.
WordPress doesn’t ship with any AI features turned on, though. At least not yet. Before anything can use AI on your site, you need to connect a provider. In this tutorial, we’ll do just that on the new “Connectors” screen. If you’d rather keep AI off your site entirely, see How to turn off AI in WordPress instead.
Before you start
You’ll need three things:
- WordPress 7.0 or later. The “Connectors” screen doesn’t exist in earlier versions.
- An API key from the provider you want to use. The “Connectors” screen links to the right page in the provider’s dashboard, so you can create one when you get there.
- Administrator access. The “Connectors” screen is only available to users who can manage the site’s settings, so you won’t see it if you’re logged in as an editor.
Note that an API key is not the same thing as a subscription to ChatGPT, Claude or Gemini. API usage is billed separately, so you’ll need to add a payment method or buy credits in the developer dashboard before the key works.
How to connect a provider
We’ll start by installing the official AI plugin, which adds the actual AI features. Then we’ll connect a provider for it to use. For this example, we’ll connect Anthropic, since that’s the provider I use most of the time. The steps are the same for Google and OpenAI.

- In the WordPress admin, go to “Settings” → “Connectors”.
- Click “Install the AI plugin” in the banner at the top of the screen. When it’s done, the banner changes to say that the plugin is installed.
- Find “Anthropic” in the list of connectors and click “Install”. Each provider needs a small plugin to talk to WordPress, and this installs and activates it for you. When the installation is done, an “API Key” field opens below. (You can manage the provider plugin from the “Plugins” page later, like any other plugin.)
- Paste your API key in the field. If you don’t have one yet, the link below the field takes you to the right page in the provider’s dashboard. The provider will probably tell you this too, but it’s worth repeating: treat your API key like a password, and don’t share it or paste it anywhere public.
- Click “Save”.

WordPress checks the key with the provider before it saves it. If the key works, the connector is marked “Connected”. If it doesn’t, you’ll see “It was not possible to connect to the provider using this key.” – probably because the key was copied incompletely.
The key is stored in your site’s database, and only the last four characters are shown on the screen. To change it later, click “Edit” and then “Remove and replace”.
Don’t see the provider you want? Anthropic, Google and OpenAI are listed by default, but other providers can add their own connectors with a plugin. You’ll find a link to search the plugin directory at the bottom of the screen. You’ll also notice Akismet in the list – the “Connectors” screen handles API keys for other services too, not just AI.
Optional: store the key in wp-config.php
If you’d rather not keep the key in the database – for example, if you share database exports with other people – you can define it in your site’s wp-config.php file instead, as long as your host lets you edit it. Add this line above the one that says “That’s all, stop editing!”:
define( 'ANTHROPIC_API_KEY', 'your-api-key-here' );
For Google and OpenAI, the constants are GOOGLE_API_KEY and OPENAI_API_KEY. The “Connectors” screen will then say “This API key is configured as a constant.”, and the key can’t be changed from the admin.
What it costs, and what gets sent
Connecting a provider is free. You pay the provider each time a feature on your site uses the key, based on how much text (or how many images) goes in and comes out. Generating alt text for a single image costs a fraction of a cent, but it adds up if a plugin processes your whole media library – especially if it’s as old as mine. If your provider lets you set a monthly spending limit, it’s a good idea to set one.
When a feature uses AI, the content it works on – a post, an image, a prompt – is sent to the provider. Check the provider’s data policy before you use it with anything you wouldn’t want to share.
What’s next?
That’s it! Your site is now connected to an AI provider. To choose which AI features to use, click “Control features in the AI plugin” in the banner on the “Connectors” screen. Other plugins with AI features can use the same connection, so you won’t have to enter your API key again. For a first thing to try, my How to generate alt text with AI in WordPress tutorial walks through one of the AI plugin’s features.


