How to Remove Unused Scripts From a Webflow Site Safely
First list every script on the site and where it lives. Test each one by blocking it in the browser before you delete it. Then remove one script at a time, publish, and check the live site.

Is your Webflow site slow, costly or hard to find?
Send me your siteWhy it matters
web.dev says even unused JavaScript has to be downloaded, parsed, compiled and executed. So unused code still costs time. It can also affect LCP and INP.
Webflow says custom code may conflict with its underlying functionality, and it cannot guarantee how it works. It also says scripts that affect DOM events, such as onClick or onHover, may cause unexpected behavior. So a wrong deletion can break something visible.
Webflow's custom code article does not say how to remove or edit existing code. It also does not mention backups for custom code. Safety is your job.
How to check it
- List where code can live. Webflow has site-wide Head code and Footer code in Site settings, then Custom code. It has page-level code in Page settings, in Inside head tag and Before body tag. It also has Code Embed elements. Page code appears after site-wide code.
- Open each place. Write down every script, what it does and who added it.
- Check the Network tab. In Chrome DevTools, disable cache and reload your published page. Note each script request and its size.
- Check Coverage. web.dev says the DevTools Coverage tab shows how much CSS and JS is not used.
- Run Lighthouse. The Reduce unused JavaScript audit shows how much unused code is sent. web.dev's third-party article says another audit lists the third-party providers a page uses. It helps spot redundant code.
- Find heavy scripts. In the Reduce JavaScript execution time audit, check Show 3rd-party resources. It reveals CPU-heavy scripts.
- Look for duplicates. Two installs of the same tool, such as GA4, create duplicate tracking.
- Look at Tag Manager. If you use it, list its tags too.
How to fix it in Webflow
- Save a restore point. Wait for "Changes saved." Press Cmd or Ctrl + Shift + S. Add a description like "Before script cleanup."
- Copy the code elsewhere. Paste each script into a note first. Webflow's article does not cover version history for custom code.
- Match each script to a purpose. Mark each as analytics, chat, forms, fonts, interactions or unknown. Ask whoever added it.
- Test by blocking. web.dev's method: right-click a request in the Network panel, choose Block request URL and reload. See if the page breaks. See if load time changes.
- Measure more than once. web.dev says third-party content can load different resources each time. Run at least three measurements and compare medians. It also says to use throttling, since fast hardware can hide costs. That article dates from 2019, so tool details may have changed.
- Remove one script at a time. Start with the clearest duplicate or dead tool.
- Delete it in the right place. Open the place you noted earlier. Remove only that script. Leave other code untouched.
- Publish. Webflow says changes will not go live until you publish.
- Test the live site. Test forms, menus, interactions, tracking and anything that used the script. Webflow says it cannot guarantee custom code behavior.
- Check tracking. If it was analytics code, confirm GA4 Realtime still shows your visit once, not twice.
- Run Lighthouse again. Compare with your first run.
- Keep what you need. For scripts you keep, Webflow suggests async or defer on external scripts in the head. It also says scripts before the closing body tag let content load before JavaScript runs.
Checklist
- A restore point exists.
- All code locations were checked.
- Each script has a known purpose.
- Duplicates were found.
- Each script was tested by blocking.
- Scripts were removed one at a time.
- The site was published after each change.
- Forms and interactions were tested live.
- Tracking was confirmed.
- Lighthouse was run again.
FAQ
Can I delete a script I do not recognize?
Not before testing. Block it in the browser first. Ask whoever added it. A restore point and a copy of the code make it reversible.
Does Webflow limit custom code size?
Yes. Webflow says each custom code section has a limit of 50,000 characters, and only HTML, CSS and JS are supported.
Why did something break after I removed a script?
Webflow warns that custom code can conflict with its functionality. Another script may have depended on the one you removed. Restore the code from your copy and test again.
Dealing with this on a live Webflow site? It is the kind of work I do in Speed. Send me your site and I will tell you what I would fix first.

