// POST

How to Connect WordPress to OpenAI and ChatGPT Without Code

September 4, 2026 10 min read Blog Posts
connect wordpress to openai no code

To connect WordPress to OpenAI without code, you get an OpenAI API key and paste it into a plugin that handles the requests. AI Workflow Automation, a free WordPress plugin, connects to OpenAI, Anthropic, OpenRouter, and Google models: add your key once, and you can generate text, chat, and run AI workflows across your site with no development work.

I wrote the plugin, so the screens below are the actual ones you will see. Budget ten minutes: roughly three for the OpenAI side, two for the WordPress side, and five for your first workflow.

What does connecting WordPress to OpenAI actually do?

Connecting WordPress to OpenAI means your site can make authenticated requests to OpenAI’s API on its own, without you copying text into ChatGPT and pasting the result back. The key is the credential that proves the request came from your account.

AI Workflow Automation is a free WordPress plugin with a visual drag-and-drop builder that runs AI workflows, agents, and chatbots inside your own site, using your own API keys, with no external subscription required.

Two distinctions matter before you start, because they cause most of the confusion around this topic.

Once connected, the same key powers everything: article drafting, product descriptions, classification of form submissions, summarisation, and a site chatbot. You add the key once, not once per feature.

How do you get an OpenAI API key?

OpenAI’s own API quickstart documentation is the authoritative source, and the flow is four steps.

  1. Create an account at platform.openai.com. If you already use ChatGPT with the same email, signing in is enough; the platform account is created alongside it.
  2. Add a payment method under Billing and buy a small amount of credit. Ten dollars is more than enough to evaluate everything in this article. API requests fail with an insufficient-quota error if the account has no credit, and this is the single most common reason a first request does not work.
  3. Open the API keys page in the dashboard and create a new secret key. Give it a name that tells you where it is used, for example “wordpress-mysite”.
  4. Copy the key immediately. OpenAI shows the full value once. If you lose it, you revoke it and create another one.

Keys start with sk-. Treat one like a password with a credit card attached, because that is exactly what it is. Do not put it in a support ticket, a theme file, or a screenshot.

How do you add the key to WordPress without code?

With AI Workflow Automation installed, the key goes into one settings field and is never touched again.

  1. In the WordPress admin sidebar, open AI Workflows.
  2. Open Settings, then the AI Services tab.
  3. Paste your key into the OpenAI field.
  4. Optionally set OpenAI as the default provider for new AI nodes, so you are not choosing it every time.
  5. Save. The plugin encrypts the key at rest in your WordPress database using authenticated AES-256-GCM encryption.

The same tab holds fields for OpenRouter, Perplexity, Fal.ai for media generation, Firecrawl for web scraping, LlamaParse for document parsing, and Unsplash. You only fill in the ones you intend to use. The API settings and integrations documentation covers each field.

In Local mode, which is the default, your provider key never leaves WordPress. AI calls go straight from your server to OpenAI. Nothing is proxied through my infrastructure, and no account with me is required for this to work.

Which OpenAI model should you choose?

The AI Model node, which appears as AI Prompt in the node palette, has a Model tab with a searchable list and a reload button that refreshes the catalogue from the provider. You are not stuck with whatever models shipped with the plugin version you installed.

Three access routes are available, and they behave differently.

Route What it gives you What it needs
OpenAI (Direct) OpenAI’s own models, billed by OpenAI at list price An OpenAI API key
Via OpenRouter Anthropic, Google, Meta, Mistral, Perplexity and OpenAI models behind one key An OpenRouter API key
WordPress AI (site default) Whatever provider your site’s AI abilities are configured with WordPress 7.0 or newer

Practical guidance from running this daily: use a small, fast model for classification, extraction, tagging and summarisation, which is most of what automation actually needs. Reserve the flagship reasoning models for long-form drafting and anything where the output goes in front of a customer unedited. The cost difference between tiers is often ten to twenty times, and for a “categorise this enquiry” step the cheap model is indistinguishable.

Check OpenAI’s pricing page before you settle on a model. Per-token rates change several times a year and any figure I quote here will age badly.

How do you run your first AI action in WordPress?

The shortest useful workflow is three nodes and takes about five minutes.

  1. In AI Workflows, create a new workflow to open the builder canvas.
  2. Drag a Trigger node on and set its type to Manual, so you can run it on demand while testing.
  3. Drag an AI Model node on and connect the trigger’s output handle to the AI node’s input handle.
  4. Pick your OpenAI model on the Model tab, then type a prompt in the prompt box. Something concrete works best for a first test, for example: “Write three blog post titles about WordPress automation for small business owners.”
  5. Drag an Output node on, set its type to Display, and connect the AI node to it.
  6. Leave execution mode on Local, save, and run. The live execution panel slides in from the right and shows each node as it runs, with its inputs and outputs.

If the AI node errors, the panel shows the provider’s raw response, which is usually enough to diagnose it: an invalid key, an insufficient-quota message, or a model name your account cannot access.

From there, everything is a variation. Swap the Manual trigger for a form submission and you have AI-drafted replies. Swap it for a schedule and you have recurring content. Add a Create Post/Product node after the AI node and the output becomes a WordPress draft. The quick start guide walks the same path with more detail.

How do you pass data into the prompt?

Prompts accept variable tags from earlier nodes. Type “/” in the prompt box and a picker lists the upstream nodes you can reference, inserting the correct syntax at the cursor. A tag looks like [[Email] from trigger-1] for one named field, or [Input from trigger-1] for the whole output of that step. The builder renders them as readable pills, so a prompt reads as “Write a reply to input from Contact form” rather than as raw syntax.

Turning on Structured output in the AI node makes the reverse true as well: instead of one blob of text, the node returns named JSON fields you define, each individually addressable downstream as [[title] from ai-1] or [[excerpt] from ai-1]. The AI Model node documentation covers the field types available.

How do you keep your API key and costs under control?

Four controls, in the order I would set them up.

  1. Set a hard budget in OpenAI. The billing section of the OpenAI dashboard lets you set a monthly usage limit that stops requests when reached. Do this before you build anything, not after your first surprise.
  2. Use a dedicated key per site. One key per WordPress install means you can revoke a compromised key without breaking everything else you own.
  3. Watch the plugin’s Cost Management tab. AI Workflow Automation tracks per-node usage under Settings, so you can see which workflow is actually consuming spend rather than guessing.
  4. Cap output length. The Settings tab of the AI Model node exposes max tokens along with temperature, top_p, top_k, and the frequency, presence and repetition penalties. A max-tokens ceiling is the simplest guard against a runaway loop generating a novel.

On security: keys are encrypted at rest, but any WordPress administrator can reach the settings screen. If you hand out administrator accounts freely, that is your real exposure, not the storage format.

Which other AI providers can you connect besides OpenAI?

Being locked to one provider is a bad position in 2026, because model quality and price both move quarterly. AI Workflow Automation supports several routes so you can switch a workflow to a different model without rebuilding it.

Because model selection is a per-node setting, migrating a workflow is a dropdown change and a re-test, not a rewrite. The AI for WordPress overview lists what each provider unlocks across the plugin.

Frequently asked questions

Do I need a ChatGPT Plus subscription to connect WordPress to OpenAI?

No. ChatGPT Plus and the OpenAI API are billed separately, and a Plus subscription grants no API access. You need an OpenAI platform account with a payment method and some credit on it. API usage is pay-as-you-go per token, so a low-volume WordPress site typically spends a few dollars a month rather than a fixed subscription fee.

Is it safe to store an OpenAI API key in WordPress?

Reasonably, with two caveats. AI Workflow Automation encrypts provider keys at rest in the database using authenticated AES-256-GCM encryption, and in Local mode the key never leaves your server. The real risks are administrator accounts you do not control and an unpatched site, so use a dedicated key per install and set a spending cap in OpenAI so a leaked key has a bounded cost.

Can I connect WordPress to OpenAI without a plugin?

Technically yes, by writing PHP that calls the API with wp_remote_post and storing the key in wp-config.php. In practice that means you also build the retry logic, the error handling, the cost tracking, the prompt interface and the scheduling yourself. A plugin exists so you do not maintain that code, which is the entire point of the no-code route.

Which OpenAI model is best for WordPress content generation?

For classification, tagging, extraction and summarisation, the smallest current model is almost always sufficient and ten to twenty times cheaper. For long-form drafting or customer-facing copy, step up to a flagship model. The AI Model node’s reload button refreshes the live model catalogue, so test two on the same prompt and compare rather than trusting a benchmark table.

Next steps

Install AI Workflow Automation from the WordPress plugin directory, add your OpenAI key under Settings, and build the three-node workflow above. When it runs, the quick start guide shows how to swap the manual trigger for a real one and turn the experiment into something that runs by itself.

Leave a reply

Your email address will not be published. Required fields are marked *