Your visitors are tired of typing into boxes. Let their AI do it. In WordPress you add the script with a Custom HTML block, right under your form. It works with Contact Form 7, WPForms, Gravity Forms and other plugins that show a normal form. It takes about five minutes.
Steps
- Open the page with your form. Open it in the block editor.
- Click the block that shows your form. It can be a plugin block or a Shortcode block.
- Put it in a Group block. Press Ctrl+G on Windows or Cmd+G on a Mac. If nothing happens, type
/groupin a new line, press Enter, and drag your form block into the Group. - Click the Group block. Open the settings sidebar with the Settings icon next to the Update button. Open Advanced.
- In Additional CSS Class(es), type
ai-fill-form. - Inside the Group, under your form, add a Custom HTML block. Click the Block Inserter icon and search for Custom HTML. Or type
/htmland press Enter. - Click Edit HTML. Paste the snippet below. Press Update in that window.
- Press Update on the page. Open the live page and look for the button above your form.
The snippet
<script src="https://aiformapi.com/agent-fill.js" data-form=".ai-fill-form form"></script>.ai-fill-form form means "the form inside the Group with the class ai-fill-form". I use a Group because most WordPress themes have a search form too. With two forms on the page, the script does not guess. It does nothing until you tell it which form.
Check it
Open the page as a visitor would. Press the button. The prompt must show the labels of your fields. If the button is missing, check that the class in the sidebar is exactly ai-fill-form.
Check the live page and not the editor. The editor is not your visitor's view.
Who can add the script
WordPress says that a user without the unfiltered_html capability, such as a Contributor, gets script and iframe tags removed when the page is saved. If your script disappears, ask an Administrator.
What I checked
I read the WordPress help pages for the steps above. I ran the snippet on a test page built like a WordPress page: a search form in the header, then a Group with the class, a form inside it, and the script after the form. The button appeared on the right form only. I did not run it on a live WordPress site.
Sources (read 2026-10-30)
Questions
Which WordPress form plugins does this work with?
It works with any plugin that prints a normal HTML form on the page, such as Contact Form 7, WPForms or Gravity Forms. I tested the steps on a test page with the same shape: a form inside a Group block with a CSS class. I have not run it on a live copy of each plugin.
Why did the script disappear after I saved the page?
WordPress removes script and iframe tags when the person who saves the page lacks the unfiltered_html capability, for example a Contributor. Ask an Administrator to add the Custom HTML block.
Why does the prompt say a required field is optional?
The script reads the required attribute of an input. Some form plugins mark required fields in another way. The prompt then calls the field optional. Your form still checks it when your visitor presses Submit.