How to Embed a Form on Your Website: A Complete Step-by-Step Guide (2026)
Embedding a form on your website is one of the most effective ways to capture leads, collect feedback, and engage visitors without redirecting them away from your page. Whether you're using a no-code website builder or a custom-coded site, this guide walks you through every embedding method available in 2026—including how to add voice-enabled forms for dramatically higher completion rates.
Why Embedding Matters: Keep Visitors on Your Page
Sending visitors to a separate form URL is a conversion killer. Studies show that embedded forms outperform linked forms by 20-40% in completion rates because users stay in context. They don't lose their place on your site, and the experience feels seamless and professional.
Voice-enabled embedded forms take this a step further—users can speak their responses directly on your page, reducing the friction of typing even further.
Method 1: Embed Using an Iframe
The iframe method works on virtually every website platform. It wraps your form inside a contained window within your page.
Basic Iframe Embed Code
```html <iframe src="https://anve.io/f/your-form-id" width="100%" height="600" frameborder="0" allow="microphone" ></iframe> ```
The `allow="microphone"` attribute is critical for voice-enabled forms—without it, browsers will block microphone access inside the iframe.
Iframe Tips - Set `width="100%"` for responsive layouts - Adjust height to match your form's length - Add `scrolling="no"` if your form fits without scrolling - Use `style="border: none; border-radius: 8px;"` for a polished look
Method 2: JavaScript Snippet Embed
Most modern form builders (including Anve) offer a JavaScript snippet embed that is smarter than a plain iframe. The script resizes automatically, handles focus management, and supports postMessage communication between the form and your page.
```html <div id="anve-form-container"></div> <script src="https://anve.io/embed.js" data-form="your-form-id" async></script> ```
Advantages Over Iframe - Auto-resizes to form height—no fixed height needed - Fires events to your analytics (form started, completed, abandoned) - Supports custom CSS variable injection for brand theming - Works better with single-page applications (React, Vue, Next.js)
Method 3: Embed on WordPress
WordPress is the most common CMS, and embedding forms is straightforward:
Using a Block Editor (Gutenberg) 1. Open the page or post editor 2. Click the + icon to add a new block 3. Search for "Custom HTML" block 4. Paste your iframe or script embed code 5. Preview and publish
Using a Classic Editor 1. Switch the editor to "Text" mode (not Visual) 2. Paste your embed code where you want the form to appear 3. Switch back to Visual to preview, then publish
WordPress Plugin Method Several plugins (Elementor, Divi, Beaver Builder) have dedicated HTML/embed widgets. Drag the widget onto your page and paste your embed code.
Method 4: Embed on Webflow
- In the Webflow Designer, drag an Embed element onto your canvas
- Double-click the element to open the code editor
- Paste your form's embed code
- Set the element to 100% width in the style panel
- Publish your site
Method 5: Embed on Squarespace
- Open a page in the Squarespace editor
- Click + to add a block
- Choose Code from the block types
- Paste your embed code
- Save and preview
Note: Squarespace may require a Business plan or higher to use custom code blocks.
Method 6: Embed on React / Next.js
For React-based sites, the cleanest approach is a dedicated component:
```jsx export default function ContactForm() { return ( <iframe src="https://anve.io/f/your-form-id" style={{ width: "100%", height: "600px", border: "none" }} allow="microphone" title="Contact Form" /> ); } ```
For the JavaScript snippet method in React, use a `useEffect` hook to inject the script after mount.
Enabling Voice Input in Embedded Forms
Voice-enabled forms require microphone permission. To ensure this works in your embedded form:
Iframe Permissions Policy Add the `allow="microphone"` attribute to every iframe that contains a voice form. Modern browsers also support the Permissions Policy header at the server level.
HTTPS Requirement Microphone access is only available on HTTPS pages. If your site is still on HTTP, voice features will not work.
User Permission Flow Browsers will ask users for microphone permission the first time they encounter a voice form. Provide brief on-page instructions ("Click the mic icon and allow microphone access") to reduce confusion.
Troubleshooting Common Embed Issues
Form doesn't show: Check if your site's Content Security Policy (CSP) blocks iframes from external sources. Add your form provider's domain to the CSP allowlist.
Voice button missing: Ensure the `allow="microphone"` attribute is present and the page is served over HTTPS.
Form cuts off: Increase the iframe height or switch to the JavaScript snippet embed for auto-resizing.
Form looks unstyled: Use your form builder's theme/branding options rather than trying to inject CSS from the parent page.
Best Practices for Embedded Forms
- Place forms above the fold or immediately after your call-to-action copy
- Add a brief headline above the form explaining what users will get
- On mobile, consider full-width placement with adequate top/bottom margin
- Test the embed on both desktop and mobile before publishing
- Monitor completion rates using your form builder's analytics dashboard
Frequently Asked Questions
Do embedded voice forms work in iframes?
Yes, as long as you add the allow="microphone" attribute to the iframe tag and your page is served over HTTPS. Without these two requirements, browsers will block microphone access.
Which embed method works best on mobile?
The JavaScript snippet embed is generally best for mobile because it auto-resizes to the form content height, eliminating scroll issues inside a fixed-height iframe.
Can I embed a form on a free WordPress plan?
WordPress.com free and personal plans restrict custom code/HTML embeds. You need at least the Business plan. Self-hosted WordPress.org sites have no restrictions.
How do I track form completions from an embedded form?
Most form builders fire postMessage events that you can listen to in your parent page's JavaScript and send to Google Analytics, GTM, or any analytics platform as conversion events.
