Add custom blocks of HTML code to your site using the Embed element to unlock all kinds of custom functionality.
Note: We’re transitioning to Workspaces, and are in the process of updating our content. Visit the Workspaces blog post to read more about these updates and changes, or visit our updated lesson on custom code embeds. You can also learn how to check if your account is on Workspaces.
The Embed element gives you the power to add custom blocks of code to your sites. If you have a paid Webflow account or if your project has an active site plan, you can use the Embed element to unlock all kinds of custom functionality.
You can embed third-party elements such as Google Docs and Sheets, social media feeds, live chat apps, forms and surveys, and much more. You can also use CMS Collection fields to dynamically update embedded code.
In this lesson, you’ll learn:
Important: Custom code is an advanced modification that may conflict with Webflow’s underlying functionality. As such, Webflow cannot guarantee the functionality or full compatibility of any custom code. Additionally, our support team is unable to provide direct help with custom code setup or troubleshooting, as these topics fall outside the scope of our customer support policy. If you run into issues with custom code, please let us know on the Webflow Forum, where the entire Webflow community (staff included) can provide additional help and resources.
You can embed third-party code or your own custom code anywhere in your design or in a rich text element.
Important: If your custom code has opening and/or closing tags, make sure to add those to ensure your code works as expected. Additionally, don’t include <html>, <body>, or <head> tags in your custom code, or your website/layout will break.
You can incorporate Collection fields into embedded code to dynamically pull information for various uses.
Learn more: Dynamic embeds
There are a number of ways to open the HTML embed code editor and edit the code in an Embed element.
You can:
If the custom code within the Embed element doesn’t explicitly set sizing or dimensions, the content can often take up the full width of its parent element. You may be able to append height="100%" width="100%" in your custom code, which will allow you to adjust the width and height of the embed element and the content from the Style panel.
Custom HTML wrapped in <iframe></iframe> or <style></style> tags will show a preview on the canvas or within your rich text element, but some code embeds can only be viewed on the live website. Any time a <script></script> tag is used in the code editor, you’ll see a placeholder for that element in the Designer.
Once you publish or export your site, the script and custom code inside will render where you placed it. If you need to preview the embed before going live with your site on a custom domain, you can publish your site to the .webflow.io staging subdomain.
Learn more: Use .webflow.io as a staging domain for testing and feedback
You can’t integrate server-side languages (e.g., Perl, PHP, Python, Ruby) in an Embed element. The Embed element only supports HTML, CSS in <style> tags, and JS in <script> tags.
Custom code in the Embed element can’t exceed 10,000 characters. If the code you want to embed is longer, you can store it on another server and reference the script in your embed. You can also minify your custom code using a third-party tool or split the code into multiple Embed elements (provided this doesn’t break any JavaScript functions).
Double-check that your code includes the appropriate opening and/or closing tags and doesn’t include <html>, <body>, or <head> tags.
As of August 2020, newly published Webflow sites include jQuery v3.5.1. Importing other versions of jQuery with custom code may cause conflicts and unexpected behavior on your site. Scripts that affect DOM events like onClick, onHover, etc., may also cause unexpected behavior.
It’s important to keep in mind that custom code is an advanced modification that may conflict with Webflow’s underlying functionality. As such, Webflow cannot guarantee the functionality or full compatibility of any custom code.
Our support team is unable to provide direct help with custom code setup or troubleshooting, as these topics fall outside the scope of our customer support policy. If you run into issues with custom code, please let us know on the Webflow Forum, where the entire Webflow community (staff included) can provide additional help and resources.
Something went wrong while submitting the form. Please contact support@webflow.com