Skip to main content

Build with AI (Pro)

Describe the form you want, in your own words, and watch it appear.

Make a registration form for the spaghetti evening on 12 September at the parish hall. Ask for the name, the email address and how many portions.

A few seconds later the form exists on your site, as a draft, with its own page - ready for you to look over and publish.

The same panel works on a form you already have. Open it in the builder and ask for a change:

Add a question asking about dietary requirements, and make the email field required.

The panel sits beside the builder rather than over it, and the form updates in place while you watch: a question the assistant adds appears in the canvas, briefly marked, without the page reloading and without losing the thread of the conversation.

While the assistant is working, the builder is greyed out and cannot be edited. What lands on the screen is what was saved, so anything typed in the meantime would be replaced by it; the form is yours again the moment the answer arrives.

What you need​

  • LocalForm Pro, and WordPress 7.0 or later - the AI client is part of WordPress from 7.0.
  • An AI provider connected to your site, with your own API key. Setting that up is the next section.
  • Administrator access. Building forms is an administrator's job, and so is this.

LocalForm holds no API key of its own and charges nothing for the feature. It asks whichever provider your site is already set up with, so what you spend is what that provider charges you, and nothing passes through us.

Setting up a provider​

Once per site, and about five minutes. WordPress 7.0 does the connecting; LocalForm only asks whatever is connected.

1. Get an API key​

Pick one of the three providers WordPress knows out of the box and create a key in its console:

ProviderWhere to get a key
Anthropic (Claude)console.anthropic.com → API keys
OpenAIplatform.openai.com/api-keys
Google (Gemini)aistudio.google.com/apikey

Copy the key when it is shown - most consoles show it once.

The key is billed to you, by that provider, for what your site uses. Building a form is a handful of short requests, so it is cents rather than euros, but the account behind the key needs to be able to pay: a key on an account with no credit or no billing set up is accepted by WordPress and then refused by the provider on the first real request.

2. Connect it in WordPress​

Go to Settings → Connectors. WordPress lists Anthropic, Google and OpenAI.

  1. Select Install on the one you chose. That installs and activates its provider plugin from WordPress.org - AI Provider for Anthropic, AI Provider for OpenAI or AI Provider for Google.
  2. Paste your API key into the field that appears for it, and save.

That is the whole connection. Any plugin on the site that uses the WordPress AI client - this one included - can now generate text, so you do this once no matter how many of them you have.

:::note The "AI" plugin is a different thing The Connectors screen offers to install the AI plugin, which adds core's own AI features (generated excerpts, alt text, featured images) under Settings → AI. Build with AI does not need it, and its Enable AI toggle does not govern this panel. Install it if you want those editor features; skip it otherwise. :::

Keeping the key out of the database​

A key typed into the Connectors screen is stored as a normal site setting - masked on screen, but not encrypted. If you would rather it lived in your configuration, WordPress looks for it in this order: environment variable, then PHP constant, then the database setting. So in wp-config.php:

define( 'ANTHROPIC_API_KEY', 'sk-ant-...' );
// or OPENAI_API_KEY, or GOOGLE_API_KEY

The provider plugin still has to be installed and active - the constant supplies the key, not the connector. And because the environment variable and constant win over the database, a stale one of those is the usual reason a key you just typed into Connectors seems to be ignored.

3. Try it​

Open Forms in the admin. The Build with AI button sits next to Add New. Ask for something small:

Make a test form with a name and an email address.

A draft form appears within a few seconds. Delete it and carry on.

Out of the box LocalForm does not pick a model: it asks the AI client for text, and the client uses a suitable model from the provider you connected - so a newer model becomes available to the panel as soon as your provider offers it. If you would rather say which one, see Choosing a model below.

Either way the model has to support tool calling, which the current models from all three providers do: the assistant works by calling LocalForm's own abilities, so a model that cannot call tools will chat pleasantly and build nothing.

Choosing a model​

LocalForm → Settings → AI Assistant.

Left alone, the AI client picks - which on a connector that offers several usually means its cheapest fast model. That is a sensible default and a poor one if you are paying for something better, so both halves of the decision can be set:

  • Provider - which connector answers, when more than one is connected. Any connected provider leaves it to the client.
  • Model - the model id exactly as the provider spells it, such as gemini-2.5-pro or claude-sonnet-4-5. The field suggests the models your connected providers currently offer, and you can type one that is not in the list.

Only models that can call tools are suggested, because the assistant builds forms by calling LocalForm and a model that cannot do that is no use here. The list is fetched from your providers and cached for a quarter of an hour; Refresh the list of models fetches it again.

The two settings behave differently on purpose:

  • A provider is binding. Ask for Google and only Google answers; if it cannot, the panel says so rather than quietly using another connector.
  • A model is a preference. One the provider no longer offers - retired, renamed, or mistyped - is passed over and the client picks instead, exactly as it did before.

So that the second case is visible rather than a suspicion, the panel names the model that answered, in small text under the conversation: Answered by google/gemini-2.5-pro. If that is not the model you chose, the one you chose is not being offered by the provider - check the spelling against the list.

To set it in code instead, which wins over the screen:

add_filter( 'localform_pro_ai_model', function ( array $choice ): array {
return [ 'provider' => 'google', 'model' => 'gemini-2.5-pro' ];
} );

If it is not working​

What you seeUsually means
No Build with AI button anywhereWordPress is older than 7.0; or AI is switched off for the site - WP_AI_SUPPORT set to false in wp-config.php, or a plugin filtering wp_supports_ai (several "turn off AI" plugins do exactly this); or you are not an administrator.
The panel says no provider answeredNo connector installed yet, or no key on it. Also happens on setups that generate text fine but will not list their models - send the request anyway, the error will say which it is.
It says the key is invalidRe-copy the key. If you typed it into Settings → Connectors, check that no environment variable or constant is overriding it.
An error about credit, quota or billingThe provider's account behind the key, not the site. Top it up in the provider's console.
An error about a connection or timeoutThe host is blocking outgoing requests. Some hosts firewall them, and WP_HTTP_BLOCK_EXTERNAL in wp-config.php does it deliberately - allow the provider's domain.
It answers, but never builds anythingThe model in use cannot call tools. Connect a current model from one of the three providers.
It keeps using a model you did not chooseThe model you named is not among the ones that provider offers - a retired name, or a typo. The Answered by … line under the conversation names the one actually used; check it against the list in Settings → AI Assistant.
The model list is empty, or reports an errorListing models is a request to the provider, and some keys are allowed to generate text but not to list models. Type the model id yourself - a typed id is used just the same.

The panel re-checks for a provider every time the screen loads, so after fixing a key you only need to reload the page - there is nothing to clear.

If no provider answers, the panel still lets you try. Some setups will not list their models but generate text perfectly well, and the error from a real attempt tells you far more than a guess made beforehand.

Where to find it​

  • Forms → Build with AI, next to Add New, to start something new.
  • The sparkle button in the builder's top bar, to change the form you have open.

Type your request, press Enter, and the panel shows each step as it happens - looking at your forms, reading one, saving one - then answers in a sentence or two saying what it did.

What it can and cannot do​

It works through the same three abilities an outside assistant uses over MCP, which means:

  • It can list your forms, read any one of them, and create or update one.
  • Everything it saves goes through the same validation as the builder. It cannot store something you could not have built by hand.
  • Reconfiguring a form never deletes the responses already collected.
  • It cannot delete a form, read a submission, or touch anything else on your site.

New forms are created as drafts unless you ask for them to go live, so nothing appears to your visitors before you have looked at it.

Good requests​

The more you say up front, the less there is to correct afterwards.

Instead ofTry
"Make a signup form""Make a signup form for the choir: name, email, voice part (soprano, alto, tenor, bass) and whether they have sung before"
"Add a date""Set the event date to 12 September at 19:30, at the parish hall"
"Add prices""Charge €25, or €15 for students - as separate rates"

Asking in your own language is fine: labels and messages are written in your site's language unless you ask for another.

Things worth knowing​

Check its work. It is a good first draft, not a final one. Read the form before publishing - especially the field names, which is what your responses are stored under.

Save your own edits first. Each change the assistant makes is saved to the form, and the builder then shows what was saved. Anything you had typed into the builder and not saved is replaced by it, so save before you ask for a change. Once you have asked, the builder is held shut until the change lands, so there is no way to lose an edit part-way through one.

One conversation at a time. The panel remembers the conversation for half an hour. Closing the panel and reopening it starts fresh.

It stops if it goes in circles. A request it cannot make sense of ends with a message rather than an endless loop.