All skills
webflow avatar

/custom-code-management

@64957b8 official
by webflowwebflow/webflow-skills126 stars
21

Add, review, or remove inline custom scripts on a Webflow site (up to 10,000 chars). Use for analytics, tracking pixels, chat widgets, or any custom JavaScript. Also manages page-level scripts.

Use this Skill: https://skilld.dev/gh/webflow/webflow-skills/custom-code-management

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ54 tokens always: the name and description. β‰ˆ1.1k when used: this file.

Custom Code Management

Add, review, and manage inline custom scripts on a Webflow site β€” analytics, tracking pixels, chat widgets, or any custom JavaScript.

Important Note

ALWAYS use Webflow MCP tools for all operations:

  • Use Webflow MCP's webflow_guide_tool to get best practices before any other tool call
  • Use Webflow MCP's data_sites_tool with action list_sites to identify available sites
  • Use Webflow MCP's data_scripts_tool with action list_registered_scripts to list all registered scripts
  • Use Webflow MCP's data_scripts_tool with action list_applied_scripts to list scripts applied to pages
  • Use Webflow MCP's data_scripts_tool with action add_inline_site_script to register a new inline script
  • Use Webflow MCP's data_scripts_tool with action delete_all_site_scripts to remove ALL site scripts (no selective delete)
  • Use Webflow MCP's data_scripts_tool with action get_page_script to get custom code for a specific page
  • Use Webflow MCP's data_scripts_tool with action upsert_page_script to add or update page-level custom code
  • Use Webflow MCP's data_scripts_tool with action delete_all_page_scripts to remove all custom code from a page
  • All tool calls must include the required context parameter (15-25 words, third-person perspective)

Instructions

Phase 1: Discovery

  1. Call webflow_guide_tool first β€” always the first MCP tool call
  2. Get the site: Use data_sites_tool with action list_sites. If only one site, use it automatically.

Phase 2: Analysis

  1. List scripts: Call list_registered_scripts and list_applied_scripts in parallel
  2. Check page-level scripts (if relevant): Use get_page_script for specific pages
  3. Present findings: Name, version, location (header/footer), registration vs application status

Phase 3: Planning & Confirmation

Before any mutation, present the plan and require explicit confirmation:

  • Adding scripts: user must type "add"
  • Removing ALL site scripts: user must type "delete all" (warn: no selective delete)
  • Page-level changes: user must type "update"

Phase 4: Execution

  1. Add site script: add_inline_site_script with displayName, sourceCode, version, location, canCopy
  2. Remove all site scripts: delete_all_site_scripts
  3. Add/update page script: upsert_page_script
  4. Remove page scripts: delete_all_page_scripts

Phase 5: Verification

  1. Re-list scripts to confirm success
  2. Report what changed (name, location, version, char count)
  3. Remind user to publish β€” suggest using safe-publish skill

Examples

Example 1: View scripts

User: "What scripts are on my site?"

  1. webflow_guide_tool β†’ data_sites_tool β†’ list_registered_scripts + list_applied_scripts in parallel
  2. Present summary of all scripts

Example 2: Add Google Tag Manager

User: "Add GTM to my site"

  1. webflow_guide_tool β†’ data_sites_tool β†’ ask for GTM container ID
  2. Preview script, require "add" β†’ add_inline_site_script (header, version "1.0.0")
  3. Verify and remind to publish

Example 3: Remove all scripts

User: "Remove all scripts"

  1. webflow_guide_tool β†’ data_sites_tool β†’ list current scripts
  2. Warn: removes ALL scripts. Require "delete all" β†’ delete_all_site_scripts
  3. Verify and remind to publish

Example 4: Page-specific tracking

User: "Add conversion tracking to my thank-you page"

  1. webflow_guide_tool β†’ data_sites_tool β†’ get_page_script to check existing
  2. Preview, require "update" β†’ upsert_page_script
  3. Verify and remind to publish

Guidelines

  • webflow_guide_tool always first β€” before any other MCP tool
  • No <script> tags β€” Webflow adds them automatically
  • Max 10,000 characters per script; displayName + version must be unique
  • Site-level scripts (add_inline_site_script) apply to all pages; page-level scripts (upsert_page_script) apply to one page
  • No selective delete β€” delete_all_site_scripts removes everything; always list scripts first so user knows what will be lost
  • Hosted/external scripts not available via MCP β€” inline only
  • Recommend header for analytics (GA, GTM); footer for chat widgets and non-critical scripts
  • If displayName + version exists, suggest incrementing the version
  • Always remind users to publish after changes

Source: SKILL.md on GitHub

No alerts5mo5 checks Β· Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill provides a legitimate way to manage custom JavaScript on Webflow sites through official integration tools. It includes safety measures such as code validation and explicit confirmation prompts for destructive actions.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW Β· No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at 64957b8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 5 months ago
  • MCP
  • webflow
  • custom-code
  • javascript
  • analytics
  • tracking
  • scripts
  • page-level

README badge

README badge for webflow/webflow-skills/custom-code-management

Adds, reviews, and removes inline custom scripts (up to 10,000 characters) on a Webflow site via the Webflow MCP tools. Use for analytics tags, tracking pixels, chat widgets, or any custom JavaScript at site or page level.

Generated from the current SKILL.md.

Can I selectively delete individual scripts?
No. The `delete_all_site_scripts` action removes all site-level scripts at once with no selective option. Always list scripts first so you know what will be deleted.
What's the difference between site-level and page-level scripts?
Site-level scripts apply to all pages on the Webflow site. Page-level scripts apply to a single page only. Use site-level for global analytics or tracking; use page-level for conversion tracking on specific pages like thank-you pages.
Do I need to include <script> tags in my custom code?
No. Webflow automatically wraps your code in script tags. Provide only the JavaScript or HTML content itself, up to 10,000 characters.
Can this skill manage external or hosted scripts?
No. This skill handles inline custom code only. External scripts hosted elsewhere are not available via the Webflow MCP tools.
Where should I place analytics versus chat widgets?
Place analytics scripts (GA, GTM) in the header for early execution. Place chat widgets and non-critical scripts in the footer to avoid blocking page load.

Generated from the current SKILL.md. These answers refresh after source changes.