ElevenAgents · Website Widget

How to Add an ElevenLabs Voice Agent to Your Website

The voice agent in the corner of this page is an ElevenLabs widget I set up myself. Here is every step, from the widget settings to a two-line snippet that works on any website, and how to load it on every page at once.

By Brad at Morgan Systems Consulting · Updated October 2026 · Part of our ElevenLabs review
Compare ElevenAgents Plans & Current Offers →

Goes straight to ElevenLabs' pricing page, including the free plan and any promotions running now.

1
The Short Answer

How do you add an ElevenLabs voice agent to a website?

You copy two lines of code from the agent's Widget settings and paste them into your site. One is a small HTML tag that carries your agent's ID; the other loads ElevenLabs' widget script. Once the code is on a page, a button appears in the corner that visitors can click to talk to your agent, or type to it if you allow text. There is no phone number to buy and nothing to install on your server.

Before you paste, two settings matter: the agent has to be public for the widget to reach it, and the allowlist in the agent's Security settings should name your domain so nobody can run your agent, and your usage, from their own site. Any site that lets you add custom code can run it, and most let you place it once so it loads on every page. This site runs on WordPress, where a code snippets plugin does that job.

Infographic: the seven steps to add an ElevenLabs voice agent widget to a website, from building the agent to testing it live1Build the agentKnowledge base, prompt, voice2Open the Widget channelDeploy, then Channels, then Widget3Style it and pick a modeVoice only, voice + text, or chat4Copy the embed codeOne tag and one script line5Lock it to your domainAllowlist under Security6Paste it into your siteOnce, site-wide, e.g. with WPCode7Test and reviewDesktop, phone, conversation historyIn the agentWidget settingsYour websiteLive
The seven steps from a finished agent to a live widget on your site.
About this guide

I built the agent in the corner of this page, configured its widget, and added it to this WordPress site myself, so the steps and screenshots below come from my own ElevenLabs account. Widget options and code details were checked against ElevenLabs' widget documentation and its own WordPress guide in October 2026. ElevenLabs updates its dashboard often, so a label may have moved by the time you read this.

Usage costs are kept off this page; see the AI voice agent pricing hub for numbers.

2
Before You Start

What do you need before adding an ElevenLabs widget?

The widget is only the front door. Behind it you need:

  • A working agent. Its knowledge base, system prompt, first message, and voice decide what visitors hear. The guided setup that builds one is walked through screen by screen in our ElevenLabs review.
  • A public agent. ElevenLabs' documentation says the widget needs the agent to be public, with authentication turned off in the agent's Advanced settings. That is why the allowlist in step 5 matters.
  • Access to your site's code. On self-hosted WordPress that means a code snippets plugin or a Custom HTML block. ElevenLabs' own WordPress guide notes that WordPress.com sites need a Business or Commerce plan to add custom scripts.
  • An HTTPS site. Browsers only let a web page use the microphone over a secure connection, so the voice side of the widget needs your site on HTTPS, which almost every site is today.

Every conversation through the widget uses your ElevenLabs plan's usage the same way a phone call would, which is another reason to lock the widget to your own domain. It is also worth setting a maximum conversation length in the agent's settings, so one very long or abusive session on a public widget cannot run up your usage.

3
Step by Step

How do you set up and embed the ElevenLabs widget?

1
Open the Widget channel

Open your agent and look for the Deploy section of the left-hand menu. Under Channels you will see every place the agent can live: Telephony and WhatsApp at the top, then Widget, then help desk channels such as Zendesk. Click Widget to open its settings.

Screenshot of the ElevenAgents Channels menu under Deploy, with an arrow to the Widget channel listed below Telephony and WhatsApp and above Zendesk Click to expand
2
Style the widget so it looks like part of your site

The top of the Widget settings controls how the button looks: colors and the avatar, which can be an animated orb in your colors or your own image. Match your brand colors and the widget reads as part of your site rather than a bolted-on tool.

Screenshot of the top of the ElevenAgents Widget settings with appearance, color, and avatar options Click to expand
3
Set the text, interface mode, and the extras

Further down, you set the labels visitors see, such as the start and end call text, and choose the interface mode: voice only, voice and text, or chat (more on that choice in section 4). ElevenLabs' documentation lists the other groups here too: feedback, terms that visitors accept before talking, a language selector, muting, and a shareable page that hosts the agent at its own link.

Screenshot of the lower ElevenAgents Widget settings with display text labels and interface mode options Click to expand
Use the terms setting

A short line telling visitors they are talking to an AI, and that the conversation may be recorded, belongs in the widget's terms. Disclosure rules for AI agents vary by location, so check what applies where your customers are.

4
Copy the embed code

The embed code is two lines: an elevenlabs-convai tag with your agent's ID in it, and a script tag that loads the widget from ElevenLabs. The agent ID is not a secret, since it appears in your page source for anyone to see, which is exactly why step 5 exists.

Screenshot of the ElevenAgents widget embed code with the elevenlabs-convai tag and the widget script line Click to expand
5
Lock the widget to your domain

In the agent's Security settings, the allowlist sets which websites may run the widget. Add your own domain, and anyone who copies your embed code onto their site gets nothing. Without it, a public agent can run anywhere its code is pasted, on your usage.

Screenshot of the ElevenAgents Security settings with the allowlist of websites permitted to run the widget Click to expand
Match the exact domain

If your site redirects between www and non-www, make sure the allowlist covers the version visitors actually land on. A mismatch here is one of the quickest ways to end up with a widget that silently does nothing.

6
Paste the code into your site, once

The widget floats in the corner of the page, so it does not need to sit inside your content. That means you can place it once, site-wide, instead of adding it to every page. On this site I used the WPCode plugin: one snippet holding both lines, set to load in the site-wide header, and the widget appears on every page, including pages published later.

Screenshot of the WPCode plugin in WordPress with the ElevenLabs widget embed code placed in the site-wide header Click to expand

This is one way to do it, not the only one. Section 5 covers putting the widget on a single page instead, and adding it to other site builders.

7
Test it on desktop and on your phone

Open your site in a fresh browser window and start a conversation. The first time, the browser asks permission to use the microphone; visitors see the same prompt. Interrupt the agent, ask it something off topic, and check that it answers from your knowledge base rather than guessing.

Screenshot of the ElevenLabs voice agent widget open mid-conversation on the Morgan Systems website on desktop Click to expand

Then do the same on a phone, where most small-business website visitors arrive. Check that the widget button does not cover your own call or booking buttons.

Screenshot of the ElevenLabs voice agent widget on the Morgan Systems website on a mobile phone Click to expand
8
Review what visitors actually asked

Every widget conversation lands in the agent's conversation history in the ElevenLabs dashboard, alongside any phone calls. Reading through it in the first few weeks shows you what visitors really want to know, and which questions your knowledge base does not cover yet. Our guide to the ElevenLabs agent knowledge base, guardrails, and testing covers how to turn those gaps into fixes.

Screenshot of the ElevenAgents conversation history listing website widget conversations Click to expand
4
Pick a Mode

Should the ElevenLabs widget use voice, text, or both?

ElevenLabs offers three interface modes for the widget. The right one depends on who visits your site and where they are when they do.

ModeHow it worksBest for
Voice onlyVisitors talk; the agent talks back. The default.Showing off the voice, hands-busy visitors
Voice + textVisitors can switch between talking and typing mid-conversation.Most small business sites
Chat modeStarts as a text chat when the visitor types first.Visitors in offices, transit, or quiet places

Mode names from ElevenLabs' widget documentation, October 2026. Separately, the agent's own setup has a Chat Only option that turns voice off for the whole agent.

A lot of people browse with the sound off, at work or on a bus, and will never press a microphone button. Voice and text covers them without losing the main reason to choose ElevenLabs, which is how the agent sounds when someone does talk to it. The voices themselves took a step forward with Eleven v4.

5
Other Options

What are the other ways to add the widget to a site?

The site-wide snippet suits most businesses, but there are other routes depending on how you want the widget to behave and what your site runs on:

  • One page only: in the WordPress block editor, add a Custom HTML block to that page and paste the code. Useful if you only want the agent on a contact or booking page.
  • ElevenLabs' own WordPress method: its guide splits the code, loading the script site-wide with a header and footer plugin and placing the widget tag on the pages where you want it. It works the same way; it is just two placements instead of one.
  • Your theme files: pasting the code into the theme's footer works, but a theme update can wipe it. A snippets plugin survives updates.
  • Dedicated plugins: third-party WordPress plugins built for ElevenLabs agents exist in the plugin directory. They add settings screens, but they are another plugin to keep updated for what is only two lines of code.
  • Other site builders: most builders, including Wix, Squarespace, Shopify, and Webflow, have a custom code or embed area. Wherever a builder lets you add code site-wide, the same two lines work.

Developers can go further. The widget accepts optional attributes that override the first message, prompt, voice, or language on a particular page, and dynamic variables that pass in details such as a page name. A small business rarely needs these, but they make it possible to greet visitors differently on, say, a pricing page.

6
Troubleshooting

Why is the ElevenLabs widget not showing on my website?

When the widget does not appear, or appears but will not connect, the cause is usually one of these:

  • The script is not loading. Check that both lines are in place and that the snippet is active. Performance plugins that delay or combine JavaScript can hold the widget script back; exclude it from those settings.
  • Your page cache is stale. Clear the caching plugin and any host or CDN cache after adding the code.
  • The allowlist does not match. The domain in the allowlist has to match the address in the browser, including www or not.
  • The agent is not public. If authentication is on, the widget cannot start a conversation.
  • The microphone is blocked. If a visitor declined the permission prompt, the browser remembers. They can allow it from the padlock icon in the address bar, or type instead if text is enabled.
  • Your site's security settings block it. If your site uses a content security policy, often set by a security plugin or your host, it may need to allow ElevenLabs' widget script and connection. Your browser's developer console shows a blocked-script error when this is the cause.
  • It is covered or covering something. Floating chat buttons, cookie banners, and back-to-top arrows compete for the same corner. Check on a phone and move whichever matters less.
7
The Bigger Picture

Is an ElevenLabs website widget enough on its own?

For some businesses it is the whole answer, and for others it is the first step. Here is how I would think about it.

Start with the widget if most leads find you online

If people discover you through search and arrive on your site with questions, a widget answers them on the spot, at any hour, with no phone setup. It is the quickest way to get an ElevenLabs agent in front of customers.

Add a phone line if most leads still call

Trades and home services still win most work by phone. The same agent can answer a business number through a telephony provider such as Twilio or SIP, but that is a separate setup step on top of the widget, covered in our ElevenAgents phone setup guide.

Plan for booking and follow-up

A widget that answers questions is useful; one that books the visit is better. ElevenAgents has no calendar or CRM of its own, so booking and lead capture come from connecting tools you already use. See how an agent books appointments through Google Calendar, Cal.com, or Calendly, and how to send every conversation to your CRM.

If you want to try it, you can build an agent on ElevenLabs and have a widget live on a test page the same day. If you would rather not build anything, ElevenLabs' ready-made Reception.ai comes with its own web widget, phone number, and booking page. For running costs, see the AI voice agent pricing hub.

The bottom line: adding an ElevenLabs voice agent to a website takes two lines of code, a few minutes in the widget settings, and one allowlist entry. Paste the code once with a snippets plugin and it appears on every page. Then spend your time where it matters: reading the conversations and improving what the agent knows. The widget in the corner of this page is the live example, so talk to it and judge for yourself. For everything else ElevenLabs offers, head back to the ElevenLabs review.

?
Common Questions

Frequently Asked Questions

No. The ElevenLabs website widget runs in the visitor's browser, so you only need an agent and two lines of embed code on your site. A phone number is a separate channel: if you also want the same agent to answer your business line, you connect a number through a telephony provider such as Twilio or SIP, as covered in our ElevenAgents phone setup guide.
Yes. The ElevenLabs widget has a chat mode that starts as a text conversation when the visitor types first, and a voice and text mode that lets visitors switch between the two. If you never want voice at all, the agent itself has a Chat Only option that turns voice off for the whole agent.
Yes, if you choose the voice and text interface mode in the widget settings. Visitors can then type or talk and switch between them during the same conversation. The default mode is voice only, so typing has to be switched on.
Yes. Add your domain to the allowlist in the agent's Security settings, and the ElevenLabs widget will only run on the sites you list. This matters because the widget needs the agent to be public, and its embed code is visible in your page source, so without an allowlist anyone could paste it onto their own site and use your agent.
Yes. The ElevenLabs widget runs in mobile browsers as well as on desktop; the widget on morgansystems.org works on a phone the same way. Visitors are asked for microphone permission the first time they talk, and the site must use HTTPS. Check on your own phone that the widget button does not cover other floating buttons such as call or booking links.
Every conversation through the ElevenLabs widget appears in the agent's conversation history in the ElevenLabs dashboard, alongside any phone calls. Each conversation can be opened to read what the visitor asked and how the agent answered, which is the quickest way to spot questions your knowledge base does not cover yet.
The ElevenLabs widget loads its script asynchronously, so the browser does not wait for it before showing your page. It is still an extra third-party script, so run your pages through a speed test before and after adding it, and exclude it from any plugin that delays JavaScript if the widget stops appearing. For what the widget connects to behind the scenes, see our ElevenLabs review.

Sources

ElevenLabs documentation, ElevenAgents section, checked October 2026: the widget customization pages, the WordPress integration guide, and the agent security and allowlist settings. Screenshots are from my own ElevenLabs account and the agent running on this site.

To review these sources and more, go to ElevenLabs and click the Docs link on that page, which opens the ElevenAgents section of the help center.