AnveVoice

Add a Voice AI Agent to WooCommerce (2026 Guide)

Add the AnveVoice voice agent to a WooCommerce store with WPCode or a small footer snippet, keep it off checkout if you want, and deal with caching rules.

How to add AnveVoice to a WooCommerce store

WooCommerce runs inside WordPress, so a site-wide footer script reaches shop, product, cart and checkout pages alike. Use a header-and-footer plugin such as WPCode, or WooCommerce's recommended Code Snippets plugin with a short wp_footer hook if you want control over which pages load the button. Steps checked against the official documentation on 2026-10-14.

At a glance

  • Where the code goes: WPCode → Code Snippets → Header & Footer → Footer, or a wp_footer snippet in the Code Snippets plugin
  • Coding needed: None for WPCode; a five-line PHP snippet if you want page rules
  • Plan limits: None on self-hosted WooCommerce; hosted WordPress plans may restrict plugins
  • Time: About 3 minutes

Before you start

This page is for WooCommerce on a self-hosted WordPress site. WooCommerce is a plugin, which means there is no separate WooCommerce theme layer to edit: the shop, product, cart and checkout pages all render through your WordPress theme, so a script added to the site footer is present on every one of them. Create an AnveVoice account at app.anvevoice.app and note the embed ID. The Free plan has no card requirement, which suits a store you are still tuning.

  • 1. Copy the tag — Here is the line, with a placeholder where your own embed ID goes. A left-aligned button needs &position=bottom-left after the ID; a dark panel needs &theme=dark. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>

Why not edit functions.php directly

WooCommerce's developer documentation on code snippets recommends the Code Snippets plugin over editing functions.php or WooCommerce files. It gives three reasons: changes in functions.php are lost when a theme updates, a single syntax error can make the website inaccessible, and many customisations in one file become hard to debug. The same reasoning applies to a script tag, so keep it out of the theme files unless you work in a child theme.

Method 1: WPCode footer box

WPCode, formerly Insert Headers and Footers, describes itself on its WordPress.org page as a plugin for inserting code such as Google Analytics, custom CSS and Facebook Pixel into the site header and footer without editing theme files. It is the quickest route when you want the voice button everywhere.

  • 1. Install and activate WPCode — In wp-admin go to Plugins → Add New, search for WPCode, then install and activate it.
  • 2. Open Header & Footer — Go to Code Snippets → Header & Footer.
  • 3. Paste into the Footer box — Put the AnveVoice tag in the Footer field and click Save Changes.
  • 4. Clear caches — Purge your page cache and CDN, then load a product page in a private window.

Method 2: a wp_footer snippet with page rules

Use this if you want the voice agent on the catalogue but not on the payment step, or the reverse. Add it as a snippet in the Code Snippets plugin that WooCommerce's docs recommend, running on the front end only. WooCommerce's conditional function is_checkout() returns true on the checkout page, so the example skips it. The hook only fires if the active theme calls wp_footer(), as virtually all maintained themes do. If the button is missing on every page, the theme omits it.

  • 1. Create a new snippet — In Snippets → Add New, name it AnveVoice voice agent and set it to run on the front end.
  • 2. Paste the hook — Add the PHP below, replacing YOUR_EMBED_ID. The tag is written exactly as AnveVoice supplies it. Code: add_action( 'wp_footer', function () { if ( function_exists( 'is_checkout' ) && is_checkout() ) { return; // leave the payment step clean } echo '<script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>'; } );
  • 3. Save and activate — Save the snippet and activate it. If the plugin reports a syntax error, it will not activate, which protects the site.

Caching and optimisation plugins

WooCommerce's caching guide says Cart, My Account and Checkout must be excluded from the page cache so they stay dynamic, and that plugins often exclude them already. Your footer script is static, so it works on cached pages, but a stale cached page will not show a newly added tag until the cache is purged. The same guide recommends avoiding JavaScript file minification with WP-Rocket. If your optimiser combines, delays or minifies scripts and the button misbehaves, exclude anvevoice.app/embed.js from those features rather than switching the optimiser off.

Check that it works

  • 1. Test a product page — Open one in a private window and look for the round microphone at the bottom-right.
  • 2. Test cart and checkout — With Method 1 the button also loads there. With the Method 2 example it should not show at checkout.
  • 3. Try the voice agent — Click it, allow the microphone, and ask about delivery or returns. The page must be served over HTTPS for the browser to offer the microphone.

Common problems on WooCommerce

  • Button on pages but not shop archives: a caching layer serves old HTML. Purge it.
  • Two buttons: the tag is in both WPCode and a snippet. Keep one.
  • Missing after theme change: the new theme does not call wp_footer, or the old tag lived in the theme. Use a plugin-based method.
  • Blocks checkout: the Cart and Checkout blocks render inside normal pages, so the footer script still loads; use Method 2 if you do not want it there.
  • Parse error in a snippet: a quote character was altered when copying. Paste the code into a plain-text editor first.

Sources

  • WooCommerce developer docs: Using the Code Snippets plugin (https://developer.woocommerce.com/docs/code-snippets/) — checked 2026-10-14
  • WooCommerce developer docs: Configure caching plugins (https://developer.woocommerce.com/docs/best-practices/performance/configuring-caching-plugins/) — checked 2026-10-14
  • WPCode on WordPress.org (https://wordpress.org/plugins/insert-headers-and-footers/) — checked 2026-10-14

Related

  • How to add AnveVoice to a WordPress site
  • How to add AnveVoice to a Shopify store
  • How to add AnveVoice to a BigCommerce store
  • How to add AnveVoice to a PrestaShop store

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.