WordPress · Drupal · Site Maintenance · Technical SEO · Editorial Policy

How to Find and Remove Injected Code on a Webflow Site

Where injected code can live on a Webflow site

Webflow is a hosted platform, so there is no server for you to patch and no theme folder of files to scan. Webflow runs and updates the platform itself. What you control is the content and configuration of your own site, and that is where unwanted code ends up: it is added through an account, a collaborator or a third-party connection, not through a flaw in files on your hosting.

In practice, malicious scripts, hidden links and redirects on a Webflow site sit in a short list of places:

  • The site-wide Custom code areas in site settings (the head and footer sections).
  • Page-level custom code in each page’s settings.
  • Embed elements placed on pages, in symbols, or inside CMS template pages.
  • Embed or rich text fields in CMS collection items.
  • Apps and integrations that have been authorized for the site.
  • Redirect rules and links in navigation, footers and buttons.

If you export your site’s code and host it yourself, you also have the files on your own server to check. That case is covered further down.

Confirm what visitors actually receive

Start with the published page, not the Designer. Injected code sometimes only appears for certain visitors, such as people arriving from a search engine or using a phone.

  1. Open the live page in a private window and view the page source.
  2. Search the source for script, iframe, eval, atob, document.write and window.location.
  3. List every external domain that a script, stylesheet or frame loads from. Mark the ones you cannot tie to a tool you use, such as analytics, a form handler or a chat widget.
  4. Open the browser’s network panel, reload, and check for requests to unfamiliar domains.
  5. Repeat on a phone and after arriving from a search result, because some redirects are conditional.

The goal is a written list of every third-party domain your pages contact. Anything on that list that nobody can explain is a lead to follow in the next sections.

Review custom code and Embed elements

Go through each place where code can be pasted in, and read it line by line rather than skimming.

  • Site settings, Custom code: read both the head and the footer sections in full. Look for long unreadable strings, code that builds a script address from pieces, and anything loading from a domain you do not recognize.
  • Page settings: custom code can be set per page. Check your highest-traffic pages first, then work through the rest.
  • Embed elements: open the Navigator in the Designer and look for Embed elements, including ones inside symbols and CMS template pages, where they repeat across many URLs.
  • Hidden elements: an element that is hidden, tiny, or positioned off screen can still hold links. Select elements in the Navigator rather than relying on what the canvas shows.

Delete only what you can identify as unwanted. If a snippet belongs to a tool you do use, keep it, but confirm the source address matches the vendor’s own documentation. Publish the cleaned site afterwards, because changes in the Designer do not reach visitors until you do.

Check CMS content, redirects and links

Code does not have to be in a template. Anyone with CMS editing access can place it in content.

  • Open collections that contain rich text or embed-type fields and look for unexpected links, especially links with unrelated anchor text such as casino, pharmacy or loan terms.
  • Check your redirect rules in the site’s hosting settings. A redirect you did not create, particularly one sending a page to an unfamiliar domain, should be removed.
  • Review navigation, footer and button links for destinations that do not belong.
  • Search your site in a search engine using the site: operator and scan for page titles or snippets you did not write.

If you need to compare against a known-good state, Webflow offers backups and the ability to restore a previous version of the site, as described in the Webflow Help Center. What is available can depend on your plan, so check there before relying on it. Restoring is a blunt tool: it can undo legitimate edits made since that backup, so note what you changed recently and redo it afterwards.

If you export code and self-host

Webflow lets paid plans export a site’s code. If you host that export yourself, the platform no longer protects the files, and your own server and deployment process become part of the risk.

  • Compare the files on your server with a fresh export from Webflow. Any difference you did not make is suspect.
  • Keep the exported files in version control, so a changed file shows up as a diff instead of going unnoticed.
  • Check for files that were never part of the export, such as extra scripts or unfamiliar folders.
  • Rotate your server, FTP or deployment credentials, and redeploy from a clean export.

If the site is hosted by Webflow, none of this applies. Your clean source of truth is the Designer and the CMS.

Close the way in and prevent a repeat

Removing the code fixes the symptom. Something gave an attacker, or a careless tool, the ability to add it, so close that path.

  1. Review workspace members and roles. Remove anyone who no longer needs access, and give people the lowest role that lets them do their job. Be especially careful with anyone who can edit custom code.
  2. Change passwords for every account with access, and turn on two-factor authentication. If your plan supports single sign-on, consider using it so access ends when someone leaves your company.
  3. Review authorized Apps and integrations. Revoke anything you do not use or recognize, and rotate any API keys you issued to outside services.
  4. Check connected accounts, such as the email address on the account and any form or automation tools, since a taken-over email can reset everything else.
  5. Add a Content Security Policy if your setup allows it. A policy limits which domains scripts may load from, and the MDN guide to Content Security Policy explains how it works. Whether you can set the needed headers depends on your hosting arrangement.
  6. Keep a change habit. Record every custom code addition with who added it and why, and review that list on a schedule.

For a broader checklist of web application risks, the OWASP site is a good reference for your developers.

Frequently asked questions

Can a Webflow site be infected the way a self-managed server can?

Webflow handles the platform and servers, so the usual route for unwanted code is access: a compromised account, an over-permissioned collaborator, a risky App or a pasted third-party snippet. The practical response is to audit access and custom code rather than scan server files.

How do I know the code is really gone?

Publish the cleaned site, then repeat the page-source and network checks in a private window and on a phone. Confirm that no unfamiliar domains are contacted and that the redirects no longer trigger. Recheck after a few days, because anything left behind in a CMS item or a second account will reappear.

Should I restore a backup or clean the code by hand?

Restoring is faster when you know a clean version exists, but it can discard legitimate recent changes and does nothing about the access that allowed the problem. Cleaning by hand is slower and more precise. In both cases you still need to rotate credentials and review members and Apps.

We use essential cookies to make this site work and remember your preferences. We do not use advertising or analytics cookies. Privacy Policy. Cookie Policy.