🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Remote Embed Premium Add-on Setup Guide

Updated 10 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What You Get
  3. Requirements
  4. Quick Start
  5. Step 1: Choose Which Websites May Embed
  6. Step 2: Paste the Snippet
  7. Step 3: How the Frame Follows the Form
  8. Step 4: Confirmations and Redirects
  9. Step 5: Pre-fill Fields and Track Submissions
  10. Save and Continue, Uploads and Payments
  11. Caching and Hosting Notes
  12. Security Summary
  13. Troubleshooting
  14. The frame shows an error page or nothing at all
  15. The form is cut off or has a scroll bar
  16. A page builder strips my script
  17. The form looks different from my site
  18. Can I use it on several sites?
  19. What happens if I uninstall the add-on?

Video walkthrough

Gravity Forms Remote Embed: Show a Form on Any Website (Non-WordPress) with One Script
Watch the Remote Embed add-on show a Gravity Forms form on a non-WordPress page, allowed for one exact address only. Watch on YouTube

Remote Embed lets you show a Gravity Forms form on a website that is not WordPress: a Webflow page, a Shopify theme, a Squarespace site, a static HTML file or any other system that lets you paste a snippet. The form keeps living on your WordPress site, so your fields, your logic, your notifications, your payment add-ons and your entries stay exactly where they are. The other website only shows a window onto it.

A studio website that is not WordPress with a heading, a short text and a Gravity Forms visit request form inside a card, and a footer line below it
A plain website page with a Gravity Forms form in the middle. The heading and the footer belong to the other site.

Gravity Forms is built for WordPress, and a form simply does not work when you copy its markup to another site. A plain iframe is the usual answer, but a plain iframe has problems: it has a fixed height, so you get a scroll bar inside the form or a big empty gap, a multi-page form jumps around, a validation error is hidden below the fold, anybody can frame your form anywhere, and the other page never learns that the form was sent. Remote Embed solves each of these with a small loader script and a careful endpoint on your site.

What You Get

  • A switch on every form called Allow remote embedding. It is off until you turn it on, and while it is off the embed address answers with an error.
  • A list of the websites that may show the form, written as exact origins with an optional wildcard for sub-domains. Only those sites are allowed to frame the form, and the browser enforces it.
  • An Embed code panel with two snippets: a script loader that resizes itself, and a plain iframe for pages that do not allow scripts.
  • A loader that is about four kilobytes with no dependencies. It builds the iframe, follows the height of the form, scrolls the page back to the top of the form after a page change, an error or a confirmation, and can load the form only when it comes into view.
  • Single-page and multi-page forms, conditional logic, file uploads, AJAX and normal submits, Save and Continue links, pre-filled fields and a confirmation that can move the whole page to another address.
  • An optional event that tells the host page when the form was sent, so you can fire Google Analytics, Meta or tag manager events.
  • A stand-alone form page without your theme, with the Gravity Forms theme framework styles, and an option to add your own stylesheet or CSS.
  • A clear notice when Gravity Forms is missing, and a clean uninstall.

Requirements

You need Gravity Forms 2.9 or newer, WordPress 6.5 or newer and PHP 7.4 or newer, and an active license key. The page that holds the form needs to allow a script tag or an iframe. Nothing is sent to an outside service. Only the license check talks to the GravityExtra site.

Quick Start

  1. Install and activate the add-on, then activate your license key under Forms, Settings, Remote Embed.
  2. Open the form you want to share and go to Settings, Remote Embed.
  3. Turn on Allow remote embedding and type the address of the website that will show the form, for example https://www.yourstore.com. Save.
  4. The Embed code panel now shows the snippets. Copy the script and paste it into the other page where the form should appear.
  5. Open the other page. The form appears, fits its own height, and sends entries to your WordPress site like any other form.

Step 1: Choose Which Websites May Embed

Type one origin per line. An origin is the scheme and the host, plus the port only when it is not the usual one: https://www.yourstore.com, or http://localhost:8080 while you test. It has no path. A wildcard is allowed for sub-domains only and only at the front: https://*.yourstore.com allows shop.yourstore.com and a.b.yourstore.com, but not yourstore.com itself, so list the plain address as well when you need both. A wildcard that would match a whole public ending, such as https://*.com, is refused.

The list is checked in two places. The browser reads it from a Content-Security-Policy header with the frame-ancestors directive, so a page that is not on the list cannot show the form even if somebody copies the snippet. The server also checks the origin that the loader reports and answers with a 403 and no form content when it does not match. Your own WordPress site is always allowed, which lets you try a form on one of your own pages. If you type something that is not a clean origin, the settings page tells you which line is wrong and does not save it.

Step 2: Paste the Snippet

The script snippet looks like this, with your own address and form number:

<script src="https://forms.yourstore.com/gfre/embed.js" data-form="12" async></script>

Put it where the form should appear. The loader inserts an iframe right after the script tag, or inside an element you name with a data-target attribute. You can paste the same snippet for several forms on one page. If the other site cannot run scripts, use the plain iframe from the second box:

<iframe src="https://forms.yourstore.com/?gfre_form=12" title="Contact" width="100%" height="800" style="border:0;max-width:100%" allow="payment"></iframe>
The Embed code panel with the script snippet and the plain iframe snippet, each with a copy button, and a note about caches
The embed code panel: a script snippet and a plain iframe, ready to copy.

The plain iframe has a fixed height, so choose a height that fits the form. It cannot resize itself, scroll the page or report events, but the allow list, the AJAX submit and everything inside the form work the same.

Step 3: How the Frame Follows the Form

The form page measures itself and tells the loader its height when it loads, when the window changes, when a conditional field appears or disappears, when a validation error is shown, when a new page of a multi-page form opens and when the confirmation replaces the form. The loader only accepts a message from the iframe that it created, and only from the WordPress site that served the script, so another page cannot resize or steer your frame.

After a page change, a validation error or a confirmation, the loader scrolls the page that holds the frame back to the top of the frame when the top is out of view. You can turn this off with data-scroll=”off” or leave room for a fixed header with data-scroll-offset=”80″. The form itself is never focused by script in a way that moves the host page.

A multi-page Gravity Forms form inside another website with the steps bar, an error message on the second page and the Back and Next buttons
A multi-page form on the other site: the frame is as tall as the form, and the page was scrolled back to the top of the frame.

Step 4: Confirmations and Redirects

A text confirmation appears in the frame and the frame shrinks to fit it. If the confirmation redirects to another page, you choose what happens. Open the page inside the frame is the Gravity Forms default. Move the whole page that holds the frame shows a short message with a link and tells the loader to send the visitor to the new address, which is what you want for a thank you page on the host site. Only web addresses starting with http or https are followed.

Step 5: Pre-fill Fields and Track Submissions

Any field that is set to be populated dynamically can be filled from the host page. Add the parameter to the script as data-param-ref=”spring” and the field with the parameter name ref starts with that value. To copy a value from the address of the host page, list it in data-pass=”utm_source,plan”. Only the names you list are passed, nothing else from the address of the page, and names that the add-on uses itself cannot be set this way. A gf_token from a Save and Continue link is always passed through.

Turn on Tell the other page when the form is sent and the loader fires a gfre:submit event on the host page window with the form number. Listen for it to send a tag:

window.addEventListener("gfre:submit", function (e) { gtag("event", "generate_lead", { form_id: e.detail.form }); });

For Google Tag Manager, add data-datalayer=”true” to the script and the loader pushes an event called gfre_submit to the data layer.

Save and Continue, Uploads and Payments

A Save and Continue link points to the page that holds the form, not to the hidden form page, and the loader hands the token back to the form when the visitor returns. File uploads work from inside the frame. Because the frame is a page of your own WordPress site, the keys of your CAPTCHA fields and your payment add-ons work as they do on any page of your site, and the frame is created with permission to use the payment request features of the browser. The entry gets the address of the host page as its source URL.

A form that requires the visitor to be logged in works on a page of your own site. On another website the browser does not send your login cookie to a frame, so the visitor sees the login message instead of the form. That is how browsers protect logins, not something the add-on can change.

Caching and Hosting Notes

The embed page is sent with headers that forbid caching, and common cache plugins honor them. Some hosts cache pages before WordPress runs, so add a rule that excludes any address that contains gfre_form: in SiteGround Optimizer add it to the excluded URLs, in WP Rocket add it under Never Cache URLs, and do the same in any other cache or CDN. A cached form page can carry an old security token or an old height. The loader script is a plain file that may be cached for an hour or more.

The script is served from /gfre/embed.js on your site when pretty permalinks are on, and from a query address when they are off. The panel always shows the one that works.

Security Summary

  • Off by default, per form. A form that is off, missing, inactive, or in the trash gives the same empty 403, so nobody can find out which form numbers exist.
  • Exact origins and a limited wildcard, enforced by the browser with frame-ancestors and by the server.
  • X-Frame-Options is sent only when it is compatible, which means as SAMEORIGIN when no outside site is allowed. It cannot name other origins, so otherwise it is left out and any copy sent by another plugin is removed.
  • Messages in both directions name their target origin and check the sender, and the page height, the redirect address and every other value in a message is checked before it is used.
  • Everything printed on the page is escaped. Custom CSS cannot close its own style tag.
  • No outside requests are made by the add-on.

Troubleshooting

The frame shows an error page or nothing at all

Check that remote embedding is on for that form, that the address of the host page is on the list exactly as the browser shows it (including www or not, http or https, and the port), and that your license is active. A 403 in the browser tools means the form or the origin is not allowed.

The form is cut off or has a scroll bar

You are probably using the plain iframe, which has a fixed height. Use the script snippet or raise the height. Also check that no style on the host page forces a height on every iframe.

A page builder strips my script

Some builders block script tags in text areas. Look for an embed or custom code block, or use the plain iframe.

The form looks different from my site

The frame uses the Gravity Forms styles of the form, not your theme. Change the form style in Gravity Forms, or add your own CSS or a stylesheet address under the Remote Embed settings.

Can I use it on several sites?

Yes. List every site, one per line. Each form has its own list, so a form can be limited to a single site.

What happens if I uninstall the add-on?

Its options and the settings stored with each form are removed. Forms and entries are not touched, and the snippets stop showing a form.

See the Remote Embed add-on

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr