1

Iframe tag to paste, with no script to load

600

Pixels, the default height in Upform's Share tab

3

Ways to share: embed, link and email button

100%

Width, so the frame follows your column

Under the hood, almost every form embed is the same thing: an iframe, a small window in your page that loads the form from the builder's servers. You copy a pointer to the form, not the form itself, which is why an embed keeps working when you edit the form, and why nearly every embed problem comes down to the window: where it sits, how big it is, and whether your site lets it open.

The examples below use the snippet from Upform's Share tab, but the steps apply to any iframe embed from any builder.

What it means to embed a form

To embed a form is to show a form hosted by a form builder inside a page on your own website. The visitor stays on your URL and answers inside the frame, and the response goes to the form builder, which still runs its spam checks (Upform uses invisible reCAPTCHA v3, covered on the security page).

There are three common ways to put a form in front of people, and each suits a different place:

MethodWhat people seeUse it for
Iframe embedThe form inside your page, at a size you setContact, signup, quote and feedback forms that belong on a specific page
LinkThe form on its own full-screen pageButtons, social posts, chat, QR codes and long forms
Email buttonA styled button that opens the formNewsletters and campaigns, where iframes do not work

Some builders also sell script-based popups and slide-in panels. Upform has neither: it gives you the iframe, the link and the email button, with no JavaScript added to your site.

Get the embed code

In Upform the code lives on the Share tab of the form builder.

  1. Publish the form. Forms stay private until published, so a draft cannot leak onto a live page.

  2. Open the Share tab. It holds three cards: Form link, Embed on your website, and Embed in email.

  3. Set the height. The Height (px) field starts at 600, and the snippet updates as you type.

  4. Copy the snippet and paste it into your page, as described for each platform below.

Share your form

Share your form via link, embed it on your website, or add it to emails.

Form link

app.upform.com/preview/client-onboarding

Embed on your website

Copy the code below and paste it into your website's HTML.

Height (px)600
<iframe src="https://app.upform.com/preview/client-onboarding" width="100%" height="600" frameborder="0" style="border:none;border-radius:8px;"></iframe>Copy

Embed in email

Most email clients don't support iframes, so use this button instead.

Fill out form →
The Share tab of a published form. The embed card writes the iframe with the form's address already in it, and the height field changes one number in the snippet.

The snippet holds the form's address, not its questions. Edit the form, press Save, and every page that embeds it shows the new version on its next load. The only setting that lives in your page is the height.

What each part of the embed code does

Here is the snippet as the Share tab writes it, with your form's ID at the end of the address:

<iframe src="https://app.upform.com/preview/your-form-id" width="100%" height="600" frameborder="0" style="border:none;border-radius:8px;"></iframe>
AttributeWhat it doesChange it?
srcYour form's address, the same as on the Form link cardNo
width="100%"Fills the column the frame sits inRarely. Size the container instead
height="600"A fixed height in pixels. The frame does not grow with the formYes, to fit your tallest question
frameborder="0"Removes the border older browsers drawOptional. The style does the same
styleNo border, corners rounded by 8 pixelsOptional. Match your site's radius

Two attributes are worth adding by hand:

  • title. Screen readers announce a frame by its title. Without one, people hear little more than "frame". Name it after what the form does, such as "Contact form" or "Event registration". The form accessibility guide covers the rest of what makes a form usable without a mouse or a screen.
  • loading="lazy". The browser waits to load the frame until the visitor scrolls near it, which keeps the page fast. It also keeps your numbers honest, because Upform counts a view when the form loads.

With both added, the snippet looks like this:

<iframe
  src="https://app.upform.com/preview/your-form-id"
  title="Contact form"
  width="100%"
  height="600"
  loading="lazy"
  frameborder="0"
  style="border:none;border-radius:8px;"></iframe>

Where to paste the snippet on your platform

Any page that accepts raw HTML can hold the snippet. Menus change between versions, so the steps below stick to the parts that stay stable. On every platform, paste into an element made for code, never a text block, which prints the code as text or removes it.

WordPress

In the block editor, add a Custom HTML block where the form should go and paste the snippet. The block has a preview option, so you can see the frame before you update the page. Page builders offer the same thing as an HTML or code widget, and in the classic editor you paste into the Text tab rather than the Visual one.

If the iframe vanishes when you save, WordPress is filtering it. Only accounts allowed to post unfiltered HTML can save iframes: administrators and editors on a standard install, and only super admins on a multisite network. Some security plugins strip iframes for everyone until you allow them.

Webflow

Add a Code Embed element, Webflow's element for custom code (older versions of the Designer call it Embed), paste the snippet into its code editor and save. Place it inside a section or div that already has the width you want, then judge the size on the published or staging site rather than in the Designer.

Squarespace

Edit the page, add a Code block where the form belongs and paste the snippet. Code blocks are not included on every Squarespace plan. If you cannot find one, check your plan, or use a button that links to the form instead.

Wix

Add an Embed HTML element, which sits under Embed Code in the editor's Add panel, choose to enter code, paste the snippet and save it. Wix runs your code inside a frame of its own, so the element's size on the canvas is what visitors see: make it at least as tall as the snippet's height. Then check the mobile view, which Wix arranges separately.

Shopify

For a page of its own, such as Contact or Wholesale inquiries, open the page in your Shopify admin, switch the content editor to HTML with its Show HTML button and paste the snippet. To place the form inside a theme template, like the home page or a product page, add a Custom Liquid section or block in the theme editor and paste the snippet there. Custom Liquid comes with Online Store 2.0 themes.

Plain HTML and frameworks

Paste the snippet into the body of the page, inside the container that sets the column width. Nothing goes in the head and there is no script to load. In React and other JSX frameworks, write the style as an object (style={{ border: 'none', borderRadius: 8 }}) and drop frameborder, which the style already covers. On any other platform, look for an element called HTML, Embed, Custom code or iframe.

Size the frame so nothing gets cut off

An iframe does not grow to fit the page inside it. Without a script on both sides to report the height, it stays exactly as tall as you set it. An Upform form fills that height and centers each question in it, and when a question needs more room than the frame has, the frame scrolls inside itself.

That makes sizing a short job with one rule: find your tallest question and make the frame fit it.

Width. Leave width="100%" alone and control the width with the container. A one-question-per-screen form reads well in a column about as wide as a paragraph of text. Stretched across a 1,400 pixel page, it is mostly empty space.

Height. The number depends on what your longest screen holds:

Your tallest questionHeight to start from
Short answers: text, email, phone, Yes/No, date500 to 600 px
A choice with four to six options, a rating or a slider600 to 700 px
Long choice lists, Picture Choice, File Upload or a long description700 to 850 px

Treat these as starting points. Your logo, font size and question length all move the number, so click through every question on the published page and raise the height until none of them scroll inside the frame.

2 →

What's your work email?

We'll reply here within one business day.

name@company.com
Next →press Enter ↵
Powered by Upform

3 →

Which service do you need?

Pick the closest match. You can add detail on the next screen.

AWebsite design
BWebsite build
CBrand identity
DOngoing support
ESomething else
Next →
Powered by Upform
Two screens of the same embedded form, at the same width. The five-option question needs far more height than the email question, so it decides how tall the frame should be.
The two-scrollbar test

If you see two scrollbars, one for the page and one inside the form, the frame is too short. If your longest question sits between wide bands of empty background, it is too tall.

Embedded forms on phones

On a phone, width="100%" does its job and the frame narrows with the column. The height does not change, and that is where mobile embeds go wrong.

  • Text wraps. A question that fits on one line on a laptop can take three on a phone, so the same screen needs more height, not less.
  • Two scrolls fight each other. When the frame is taller than the screen, or scrolls inside itself, a swipe can move the form instead of the page. Keep the frame shorter than the phone's screen where you can, and if the form needs more height than that, link to it instead.
  • The keyboard takes half the screen. Each question sits in the middle of the frame, so in a very tall frame the field lands low, right where the keyboard opens. A frame close to the height the question needs keeps the field and its Next button in view.
  • Only a real phone tells the truth. A browser's device mode is a fair first check, but the keyboard and the swipe only show up on a device.

If a phone needs a different height from a laptop, set it with CSS instead of the attribute. CSS wins over the height attribute:

<style>
  .form-embed { width: 100%; height: 600px; border: none; }
  @media (max-width: 600px) {
    .form-embed { height: 680px; }
  }
</style>

<iframe class="form-embed" src="https://app.upform.com/preview/your-form-id"
  title="Contact form" loading="lazy"></iframe>

For a long form, a link is often kinder than an embed on phones. The next section covers when to make that switch, and the multi-step forms guide covers how to keep a long form short in practice.

Embedding keeps people on your page. Linking gives the form the whole screen, and for a form that shows one question at a time, the whole screen is often the better place. Link instead of embedding when:

  • The form is long. Ten or more questions, or a file upload, reads better full screen than in a box halfway down a page.
  • It is shared away from your site. Social bios, chat, texts, QR codes and email all need a link.
  • Your platform will not take code. A button that links to the form works on any plan and any system.

The link is on the Form link card of the Share tab. Put it behind a button that names the action, such as "Request a quote", and say how long the form takes. To keep your page open behind it, open the form in a new tab:

<a href="https://app.upform.com/preview/your-form-id" target="_blank" rel="noopener">
  Request a quote (2 minutes)
</a>

A middle ground is to embed a short form, such as a two-question lead capture form, and point people to the longer one afterwards. The Thank You screen has a button whose label and link you set, and it opens that link in a new tab, so the page holding the embed stays put. Set both before the form goes live, so the button points somewhere useful.

Putting a form in an email

You cannot embed a working form in an email. Most email clients, including Gmail and Outlook, do not render iframes or run scripts, so the form would arrive as a blank space. The practical answer is a button that opens the form in the browser, and the Embed in email card on the Share tab writes one for you:

<a href="https://app.upform.com/preview/your-form-id" target="_blank" style="display:inline-block;padding:12px 24px;background-color:#171717;color:#ffffff;text-decoration:none;border-radius:8px;font-family:Arial,sans-serif;font-size:14px;font-weight:500;">Fill out form →</a>

The styles are written inline because many email clients ignore style sheets. To use it:

  1. Paste it into an HTML block. Most newsletter builders have one. A normal text block shows the code instead of the button.

  2. Rewrite the label. Replace "Fill out form" with the action itself: "Rate your stay" or "Pick a session".

  3. Change the color. Swap the background-color value for your brand color, with enough contrast for the white text.

  4. Send yourself a test and tap the button on your phone before it goes to your list.

One line above the button saying how long the form takes tells people what they are agreeing to before they click.

Troubleshooting an embedded form

Start with the symptom you can see.

The frame is blank, or says the content is blocked

A Content Security Policy on your site is the usual cause. A CSP is a response header that lists which outside sources a page may load, and its frame-src directive controls iframes. If the form's origin is not on that list, the browser refuses to load the frame and logs an error naming frame-src in the developer console. Add the origin to the directive:

Content-Security-Policy: frame-src 'self' https://app.upform.com

If your policy has no frame-src, browsers fall back to child-src and then default-src, so add the origin to whichever one it uses. The policy is set by your server, hosting platform, a security plugin or a meta tag in the page head. Keep https:// in the address too: browsers block a plain http frame on an https page.

The form is cut off, or scrolls inside itself

The frame is shorter than your tallest question. Raise the height and click through every question, not only the first, then repeat on a phone.

The code disappears when you save

The platform is stripping iframes. In WordPress, save as an account that can post unfiltered HTML, or allow iframes in your security plugin. Elsewhere, check that you pasted into a code element.

The frame says Form Not Published

The form is a draft, or was unpublished, so the frame shows a Form Not Published screen instead of the questions. Publish it in the builder and reload your page. The snippet does not change.

This form is unpublished

Publish your form first to make it accessible to respondents.

The Share tab warns you before you paste anything. Until the form is published, the frame shows visitors a Form Not Published screen instead of the questions.

Your latest edits are missing

The embed loads the saved version of the form. Press Save in the builder, then reload the page that holds the embed. There is nothing to paste again.

The frame is empty inside your site editor

Many site editors do not run custom code while you are editing. Preview or publish the page and check it there before you change anything.

Views look high compared with starts

Without loading="lazy", the form loads, and counts a view, for every visitor to the page, including people who never scroll to it. Add lazy loading, and judge the form by its completion rate (submissions divided by starts) in form analytics.

An embed checklist

Run through it once before the page goes live, and again after you change the form.

  • The form is published and saved, and the embed shows the latest version.
  • The snippet sits in an HTML or code element, not in a text block.
  • The frame has a title that names the form.
  • Width is 100% inside a column about as wide as a paragraph.
  • The height fits the tallest question on a laptop and on a real phone.
  • Lazy loading is on if the form sits below the first screen of the page.
  • Your Content Security Policy allows the form's origin in frame-src.
  • Emails use the button snippet, and long forms or off-site shares use the link.

Match the form's colors, font and corner radius to the page in its design settings. The embed form on website page covers everything else the Share tab does. For what goes inside the form, read form design best practices.

Frequently asked questions

How do I embed a form on my website?

Copy the form's iframe embed code from your form builder and paste it into an HTML or code element on your page, such as a Custom HTML block in WordPress, a Code Embed element in Webflow or a Code block in Squarespace. In Upform the snippet is on the Share tab of a published form. Set the height so your tallest question fits, then check the published page on a laptop and on a phone.

Can I embed a form in HTML without coding?

Yes. The embed code is a single iframe tag that you copy and paste, with nothing to write or install. Most site builders have an element you drag onto the page to hold it, and the only value you may want to change is the height in pixels.

Why is my embedded form not showing?

The most common cause is a Content Security Policy on your site that does not allow the form's origin in frame-src, so the browser refuses to load the frame. Other causes are a platform that strips the iframe when you save, a site editor that does not render custom code until you publish, and a form that has not been published yet.

What height should an embedded form be?

Tall enough for your tallest question without a scrollbar inside the frame. Upform's Share tab starts at 600 pixels, which suits short questions, while long choice lists, Picture Choice and File Upload questions usually need 700 pixels or more. Check every question on a phone too, where text wraps and needs extra room.

Can I embed a form in an email?

Not as a working form, because most email clients, including Gmail and Outlook, do not render iframes. Use a button that opens the form in the browser instead. Upform's Share tab gives you one as a snippet of email-safe HTML to paste into your email tool's HTML block.

Is embedding a form free in Upform?

Yes. The iframe embed, the public link and the email button are all on the free plan, which is $0 forever with unlimited forms and unlimited responses. Forms on the free plan show a small Upform badge in the corner of the frame, and Pro, at $12 a month, removes it.

Get started

Build a form worth putting on your site

One question per screen, your colors and fonts, and one iframe to paste into any page. The link and the email button come with it.

No credit card. Unlimited forms and responses on the free plan.