How to Embed Inline Forms in Magento Open Source

To embed a Reform form in Magento Open Source, publish the form, copy its inline embed code, and paste it into a CMS page using Page Builder’s HTML Code element or the classic editor’s HTML source mode.
Getting the code onto the page is only part of the job. This guide covers 3 checks before launch:
- Page setup: Confirm the page is enabled, uses the correct store view, and keeps the full embed code after saving.
- Browser permissions: Use HTTPS and check editor filtering, CSP, and framing rules without disabling security controls.
- Live testing: Clear affected caches, check desktop and mobile display and keyboard access, then test validation, submission, notifications, and connected tools.
A saved embed isn’t proof of a working form. Test the full submission flow on the live storefront, and repeat those checks after changes.
Magento Inline Forms: Embed-to-Launch Checklist
Add the Embed Code to CMS Content
In the page Content area, add a brief heading and short intro explaining what the form is for. Use Page Builder or WYSIWYG source mode, depending on your setup.
Paste the Embed into a Page Builder HTML Code Element
In Page Builder, add a row or column where you want the form to appear. Drag an HTML Code element into place, then paste the full Reform embed into the HTML field.
Keep the entire snippet intact, including scripts, iframe or container markup, IDs, URLs, and data attributes. Reform’s embed script helps the form resize automatically and supports multi-page navigation.
Paste the Embed in WYSIWYG Source Mode
If your page uses the classic editor rather than Page Builder, open the HTML source control before pasting. Place the full embed after the relevant heading or paragraph. Don’t paste it into the visual editor, where the markup may appear as text.
Save the page, then check for filtering or script restrictions.
sbb-itb-5f36581
Save the Page and Check Embed Restrictions
After saving, reopen the page in source mode and check that the code hasn’t changed. A successful save doesn’t mean the form will load. Both the published page and the embedded form must load over HTTPS.
Check Editor Filtering and Script Controls
If <script> or <iframe> tags disappear after saving, ask an administrator or developer to check the editor settings and content filtering. Use a theme or module integration if the editor removes the code. Don’t disable filtering sitewide.
If the code stays intact, check the browser next.
Check Content Security Policy and Frame Permissions
If the form won’t load, open the browser’s developer tools on the published page. Check the Console and failed requests in the Network panel.
Depending on your Magento setup, a developer may need to allow specific origins for script-src, frame-src, or connect-src in a custom module’s csp_whitelist.xml. Inline scripts may also need Magento-supported nonce or hash handling. Don’t disable CSP or add broad wildcards.
If you see a frame-ancestors or X-Frame-Options error, the form provider must allow your domain. Changing Magento CSP settings won’t override the provider’s rule.
Troubleshoot Missing or Broken Forms
Use these checks to find out whether Magento, the browser, or the form provider is blocking the embed.
| Symptom | Likely cause | Action |
|---|---|---|
| Scripts or iframes disappear after saving | Filtering removed the embed | Review editor filtering. |
| Form area stays blank | Blocked resource or framing rule | Check the Console and failed requests. |
| Console reports a CSP violation | Missing origin or inline permission | Add narrowly scoped CSP permissions. |
| Browser reports mixed content | HTTP resource on an HTTPS page | Use HTTPS URLs. |
| Saved embed markup differs | Editor rewrote the snippet | Restore it in source mode. |
Clear Caches and Test the Published Form
After saving the embed and confirming it passed filtering, test the live storefront URL, not the Admin preview.
Clear Affected Magento and External Caches
Go to System → Cache Management and flush the affected cache types. If your store uses Varnish or a CDN, purge the page there, too. Then open the storefront in a private browser window to check the updated embed.
Test Display, Accessibility, and Browser Errors
Check the page on desktop and mobile. The form should fit its container without clipping or horizontal scrolling. Tab through every field and button, confirm that focus states are visible, and check that each label is correctly associated with its field.
Keep the Console and Network panels open as the live page loads. Check for browser errors or blocked requests that could stop the form from working.
Test a Complete Form Submission
Once the page displays correctly, test the form from start to finish.
Submit test data and check required fields, email validation, the success message or redirect, and notification delivery. Confirm that fields map correctly to connected marketing or CRM tools. For multi-step forms, also check conditional routing and partial-response tracking.
Conclusion: Keep the Embed and Submission Flow Working
Save a copy of the final embed code to compare with Magento’s saved markup. If scripts or frames are blocked, allow only the required origins in CSP - don’t grant broad script or frame permissions.
Run these checks again after any form, theme, editor, security, or CDN change. Clear the affected caches, then test a full submission on the live page before closing the change.
For troubleshooting, record the page URL, deployment time, cache flushes, and test result.
FAQs
Can I reuse one Reform form across multiple store views?
Yes, you can use the same Reform form across multiple Magento store views. Add the same iframe or headless embed code to each store view’s template files or CMS blocks.
First, set the form to "Published" in your Reform dashboard. Then copy its embed code from the Share tab and paste it wherever you want the form to appear in each store view.
Will form edits update my Magento embed automatically?
It depends on how you embed the form. With the standard iframe embed code, your form stays synced with the builder. Any edits appear automatically on your site.
With a headless embed, you use your own HTML and CSS on the page. When you change the form in the builder, you’ll need to update that code manually.
How can I keep an embedded form from slowing my page?
Use the latest embed code from your Reform dashboard - it’s optimized for lazy loading. Load each script only once to avoid wasting bandwidth and slowing down your page.
If your form includes images, compress them to reduce file sizes. Set form scripts to load asynchronously so your main page content can render without waiting for them.
Related Blog Posts
Get new content delivered straight to your inbox
The Response
Updates on the Reform platform, insights on optimizing conversion rates, and tips to craft forms that convert.
Drive real results with form optimizations
Tested across hundreds of experiments, our strategies deliver a 215% lift in qualified leads for B2B and SaaS companies.

.webp)


