AnveVoice

Add a Voice AI Agent to ProcessWire

Add the AnveVoice voice agent to a ProcessWire site by putting one script tag in the shared _main.php output file, with template cache and per-page notes.

How to add AnveVoice to a ProcessWire site

ProcessWire has no global script setting because the markup is yours. Put the AnveVoice tag in the one file that prints the page shell, usually site/templates/_main.php, and clear any template cache so visitors get the new markup. Steps checked against the official documentation on 2026-10-14.

At a glance

  • Where the code goes: site/templates/_main.php (the appended layout file), above </body>
  • Coding needed: Paste one line into a PHP/HTML file; no PHP logic required
  • Plan limits: None. ProcessWire is self-hosted open source
  • Time: About 3 minutes

Find the file that prints your pages

ProcessWire template files live in /site/templates/. How the final HTML is assembled depends on the site's output strategy. The documentation describes direct output, delayed output, and markup regions. In the delayed pattern, an _init.php file sets defaults, individual template files change what differs, and _main.php holds the whole HTML document, so the head and footer are printed there. ProcessWire loads these automatically when site/config.php sets prependTemplateFile and appendTemplateFile. Your own site might be set up differently, for example with separate head and foot include files or a profile such as the default site profile. The goal is the same: find the single file whose output ends with the closing body tag. Open Setup > Templates, choose a template, and look at its Files tab to see whether prepend or append files are active; the markup regions page notes the append setting can be disabled per template.

  • 1. Get your embed ID — Sign in at app.anvevoice.app on the Free plan, create a voice bot for your site, and copy its embed ID into the tag. Optional parameters set the corner and colour scheme. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>

Method 1: edit _main.php

If your _main.php uses markup regions, the same line works unchanged, since regions only transform elements that carry ids or pw- attributes. The documentation also shows defining an empty optional region before </body> that individual templates can append to, which is useful if only some templates should load the voice agent.

  • 1. Open the file — Edit site/templates/_main.php over SFTP or in your editor. Locate the closing </body> line near the bottom.
  • 2. Paste the tag — Add the AnveVoice line on its own line directly above </body>. It sits outside any PHP tags, so it prints as plain HTML.
  • 3. Save and reload — Upload the file if you edited locally, then reload a page while logged out of the admin.

Method 2: only on certain templates

To limit the agent, wrap the line in a PHP condition inside _main.php. For example, compare $page->template->name with the templates you want, and print the tag only for those. With markup regions, an empty region plus a pw-append attribute in the chosen template file achieves the same result without PHP in the layout. The documentation notes the value form of the attribute should be used so the script's src is kept.

Template cache and updates

ProcessWire can cache rendered page output per template. The API reference describes cacheTime in seconds, where 0 disables caching, and useCacheForUsers, where the default of 0 serves the cache to guest visitors only. That means you may stay logged in, see the new tag, and wonder why visitors do not, or the reverse. After editing _main.php, clear the cache for affected templates or temporarily set cacheTime to 0 while testing. The cacheExpire setting controls what gets expired when a page is saved, but changing a template file is not a page save, so expect to clear it yourself.

Check that it works

  • 1. Use a private window — Because caching targets guests, a private window shows what visitors receive.
  • 2. Look for the button — The round microphone appears bottom-right by default. Click it, allow microphone access and ask a question.
  • 3. Verify the markup — View source and search for anvevoice.app. One match means one copy; ProcessWire itself will not duplicate it.

Common problems

  • No change on the live site: the output is cached. Clear the template cache or wait for the cache time to elapse.
  • Tag appears on some pages only: those templates do not use the appended _main.php, or they bypass it with their own full HTML.
  • Parse error after editing: you placed the tag inside an open PHP block. Close PHP first with a closing tag, or move the line outside the block.
  • Microphone blocked: the site needs HTTPS; check the hostname you are testing on.

Sources

  • ProcessWire docs: Delayed output (_init.php, _main.php, append/prepend template files) (https://processwire.com/docs/front-end/output/delayed/) — checked 2026-10-14
  • ProcessWire docs: Markup regions (appendTemplateFile, regions, pw-optional) (https://processwire.com/docs/front-end/output/markup-regions/) — checked 2026-10-14
  • ProcessWire API reference: Template (cacheTime, useCacheForUsers, cacheExpire) (https://processwire.com/api/ref/template/) — checked 2026-10-14

Related

  • How to add AnveVoice to a Grav site
  • How to add AnveVoice to an ExpressionEngine site
  • How to add AnveVoice to a DNN site
  • How to add AnveVoice to a plain HTML website

Try AnveVoice on your site

Free plan: $0, 50,000 tokens a month, no card. Get your embed ID in the dashboard, then paste one tag.