Best for · Website builders
Webflow custom code: where it goes and what it costs
- Last checked
- 4 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- Webflow gives you four places for custom code: Site settings (head and footer code for every page), Page settings (head and before </body> for one page), the Code Embed element (HTML, CSS or JavaScript placed on the canvas) and CMS Rich text fields.
Compared here
- 01Site settings custom code
- 02Page settings custom code
- 03Code Embed element
- 04CMS Rich text embeds
- 05Code components
- 06Custom code API
Short answer
Webflow gives you four places for custom code: Site settings (head and footer code for every page), Page settings (head and before </body> for one page), the Code Embed element (HTML, CSS or JavaScript placed on the canvas) and CMS Rich text fields. Webflow's update page says all four now take up to 50,000 characters, on all paid sites and workspaces.
The plan question: Webflow's pricing page marks custom code as not included on the free Starter site plan and included from Basic ($15 a month per site billed yearly). Using CMS data inside embeds ("dynamic custom code") and code components need Premium ($25). Below: what to put where, a cheat sheet for common scripts, the API route for apps and the mistakes that break sites.
Sponsored links. We may earn a commission; it never changes the pick.
At a glance
| Where | Runs on | Best for | Limit quoted | Plan we found |
|---|---|---|---|---|
| Site settings: Head code | Every page, inside head | Analytics, verification tags, fonts, global CSS | 50,000 characters | Basic and up |
| Site settings: Footer code | Every page, before closing body | Chat widgets, global scripts that wait for the page | 50,000 characters | Basic and up |
| Page settings | One page (or one CMS template) | A script only one page needs | 50,000 characters | Basic and up |
| Code Embed element | Where you drop it on the canvas | Forms, maps, widgets, small HTML blocks | 50,000 characters | Basic and up; CMS data inside needs Premium |
| CMS Rich text embeds | Inside a CMS item | A video or tweet inside one blog post | 50,000 characters | Premium (CMS plan) |
| Custom code API | Site or page, via an app | Apps that install scripts for users | 10,000 characters per inline script | OAuth apps only |
Money first. Webflow pays affiliates 50% for 12 months, so the Webflow link on this page may earn us money if you buy a plan. That does not change what we tell you, which includes "you may not need a paid plan yet". We did not build a test site for this page. Limits and plan details come from Webflow's pricing page, its update on the custom code limit and its custom code guide on the docs site, all read on 4 December 2026. Webflow's help center blocked our reader, so steps are described as the settings are named on Webflow's own pages.
Here is the plain version. Webflow does most things without code. Custom code is the back door for the rest: an analytics tag, a booking widget, a cookie script, a bit of CSS the Designer cannot do, a chat bubble. It is easy to add and easy to break things with, so the trick is knowing which door to use.
The four places custom code goes
1. Site settings: Head code and Footer code
Code here loads on every page of the site.
- Head code lands inside the
<head>tag. Use it for things that must load early or that search engines and tools read: analytics tags, site verification meta tags, font links, global CSS. - Footer code lands just before the closing
</body>tag. Use it for scripts that need the page to exist first: chat widgets, popups, scripts that select elements on the page.
Rule of thumb from years of broken sites: if a script touches page elements, it goes in the footer.
2. Page settings: per page head and body
Each page has its own custom code fields in its settings. Use them when only one page needs the script: a calendar embed script on the booking page, a conversion tag on the thank you page. On a CMS template page, the code runs on every item that template renders, so one paste covers all your blog posts.
3. The Code Embed element
Drag a Code Embed element onto the canvas and paste HTML, CSS or JavaScript. It appears exactly where you place it in the layout. This is the right home for an iframe map, a third-party form, a pricing widget or a small HTML block Webflow cannot build natively.
4. CMS Rich text embeds
Inside a Rich text field in a CMS item, you can add an embed. Good for one blog post that needs a specific video, a tweet or a chart. Webflow's update counts Rich text fields under the same 50,000 character limit.
The 50,000 character limit
Webflow's update page says: "You can now add up to 50,000 characters of custom code across Site settings, Page settings, Code Embed elements and CMS Rich text fields", and that the new limit "is now available on all paid sites and workspaces". Plenty of old forum threads quote 5,000, 10,000 or 20,000 characters. Ignore them.
If you are near 50,000 characters, something is off. Host the big script on a CDN or your own server and load it with a single <script src="..."> line. Smaller pages, easier updates, faster site.
Which plan you need
From webflow.com/pricing, site plans billed yearly:
| Feature | Starter (free) | Basic ($15) | Premium ($25) |
|---|---|---|---|
| Custom code (site and pages) | Not included | Included | Included |
| Dynamic custom code (CMS data in embeds) | Not included | Not included | Included |
| Code components | Not included | Not included | Included |
| Custom domain | No | Yes | Yes |
The pricing page describes custom code as adding "custom code and scripts to your entire site or individual pages". On the Workspace side, the free Starter Workspace does not list custom code for staging sites, while Core ($19 a month billed yearly) does. If you only build on the free plan to learn, you can design with embeds, but plan on Basic before launch. More in our Webflow pricing breakdown.
Dynamic custom code with the CMS
On Premium, you can drop CMS fields into a Code Embed on a template page. Each item then outputs its own values. Real uses:
- Schema markup per blog post or product, filled from CMS fields.
- A map pin per location item, using the item's address field.
- A booking button per service, with the service ID from a field.
- Video embeds where each item stores only the video ID.
This is where custom code stops being a hack and starts saving hours. It is also where a typo in one field breaks one page quietly, so check a few items after publishing.
A cheat sheet: what goes where
| Script | Where to put it | Why |
|---|---|---|
| Google Analytics or a tag manager | Site settings, Head code | Needs every page, early. See our Webflow Google Analytics guide |
| Search Console verification meta tag | Site settings, Head code | Read from the head |
| Chat widget | Site settings, Footer code | Loads after the page |
| Conversion pixel on thank you page | Page settings of that page | Only one page needs it |
| Calendar or booking iframe | Code Embed element | Must sit in the layout |
| Custom CSS tweak | Site settings, Head code inside a style tag | Applies site wide |
| Scroll or animation library | Footer code, or use Webflow Interactions first | See Webflow scroll animation |
| Per-post schema | Code Embed on the CMS template | Needs Premium |
The custom code API, for apps
If you are building a Webflow App that installs scripts for other people, Webflow's docs describe a separate route:
- Register a script as inline (you send the source, without script tags, and Webflow hosts it on its CDN) or hosted (you send a URL plus an integrity hash Webflow uses to check the file).
- Inline scripts are limited to 10,000 characters each.
- Apply scripts at the site or page level, in the header or footer location.
- Each script needs a unique display name and semantic version. "You cannot overwrite scripts at this time"; you register a new version instead.
- Only Webflow Apps using OAuth tokens can call these endpoints. Site tokens and Workspace tokens cannot.
- Changes go live only after the site is published, and the docs advise apps to prompt users rather than publish for them.
If you only want to add a script to your own site, ignore the API and paste it into settings. If you want to manage CMS content by script, that is a different API, covered in our Webflow CMS API guide.
The mistakes that break Webflow sites
- Not republishing. Custom code changes reach the live site only after you publish.
- Unclosed tags. One missing
</div>in an embed can swallow the rest of the page. - Scripts in the wrong place. Code that selects elements, placed in the head, runs before the elements exist. Move it to the footer.
- Pasting the same tag twice. Once in Site settings and once through an app or a page field means double tracking. Webflow's docs warn that manually pasted code can run twice if an app also applies the same script.
- Third-party scripts you do not trust. Every script you paste can read your page and your visitors' input. Only add code from vendors you would hand your keys to.
- Copying code from a dead forum post. Old snippets use old jQuery versions and old limits. Check the vendor's current install instructions.
Do you even need custom code?
Often not. Webflow Interactions handle most animation, native forms handle most forms, and the Apps marketplace covers many integrations without pasting anything. Reach for custom code when a vendor gives you an embed snippet, or when you need a tag on every page. If you find yourself writing hundreds of lines of JavaScript, that is a sign the site wants a different tool or a proper code component on Premium.
Bottom line
Global scripts go in Site settings (head for early, footer for anything that touches the page). One-page scripts go in Page settings. Things that must sit in the layout go in a Code Embed. Keep each under 50,000 characters, put the site on Basic before you rely on it, and on Premium if you want CMS data inside the code. Then publish, and test on the live URL with the console open. For more Webflow guides, see the website builders hub.
What we could not verify
Webflow's help center articles on custom code and the Code Embed element blocked our reader on 4 December 2026, so exact menu paths are described as the settings are named on Webflow's pricing and update pages. The pricing page's comparison table marks features with dashes and checks; we read the dashes as "not included" for the plans noted above.
Questions people ask
How do I add custom code in Webflow?
For every page, open Site settings, then the custom code section, and paste into Head code or Footer code. For one page, open that page's settings and use its head or before body fields. To place code inside the layout, drag a Code Embed element onto the canvas. Publish the site to see the result live.
What is the custom code character limit in Webflow?
50,000 characters. Webflow's update says you can now add up to 50,000 characters of custom code across Site settings, Page settings, Code Embed elements and CMS Rich text fields, on all paid sites and workspaces. Older forum posts mention 5,000, 10,000 or 20,000; those numbers are out of date.
Can I use custom code on the free Webflow plan?
Not on a live site, per Webflow's pricing page, which marks custom code as not included on the free Starter site plan and included from Basic at $15 a month billed yearly. Using CMS fields inside embeds needs Premium. On the Workspace side, custom code on staging sites comes with the Core plan.
Why is my custom code not working in Webflow?
The usual causes: the site was not republished, the script sits in the head but needs the page loaded (move it to the footer), a missing closing tag breaks the layout, or the code is on the wrong page. Check the published site with the browser console open; errors there tell you which line failed.
Can I put CMS fields inside Webflow custom code?
Yes, on Premium. Webflow's pricing page calls it dynamic custom code: using CMS data inside custom code embeds, and it is marked as not included on Starter and Basic. On a CMS template page, you insert fields into the embed, so each item can output its own values, like a unique map pin or schema data.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- Webflow update: Increased custom code character limit, checked 4 Dec 2026
- Webflow pricing, checked 4 Dec 2026
- Webflow docs: Custom code (apps and the Data API), checked 4 Dec 2026
- Webflow Help Center: Custom code in head and body tags (blocked our reader, cited for reference), checked 4 Dec 2026