Steel tube scaffolding with wooden boards, ladders and orange safety netting around a three-storey red brick house between two stone cottages, with a cement mixer, a wheelbarrow, pallets and a covered pile on a cobbled street in low morning sun

Scaffolding clamps onto the outside of a building. It was never meant to hold it up.

Add Custom Code to Wix: What Snippets Can and Can’t Do

Sooner or later, many Wix sites need something the editor doesn’t offer: a chat widget, a cookie banner from a privacy service, a verification tag from Google, a booking widget from another company, or a few lines of CSS. Wix has a box for pasting that kind of code. It also has several other places for it, and some kinds of code only work in one of them.

This guide covers each way to add code to a Wix site, which editors and plans each one needs, what pasted snippets do well, why they break, and the signs that a site needs more than a snippet can give it. Wix details in this guide are taken from Wix’s Help Center and developer documentation, and the structured data guidance from Google Search Central. Everything was checked on October 9, 2026, and Wix’s tools change frequently, so confirm a detail on the linked page before relying on it.

Custom code on Wix: key facts

QuestionAnswer
Where do you add custom code on Wix?In your site’s dashboard under Settings > Custom Code, for snippets that load in the page’s head or body. Visible widgets go in an Embed HTML element on the page instead.
Which Wix editors support custom code snippets?All of them. Wix’s developer docs say “Custom code can be used in all Wix editors,” including Wix Harmony.
Is a paid plan required?In practice, yes. Snippets only work once the site is published on a connected domain, and connecting a domain requires a Premium or Studio plan.
Can a snippet use Wix data, such as products, bookings or members?No. Snippets have no access to Wix APIs or page elements and run in the visitor’s browser alone.
Can you add Google Analytics, Google Tag Manager or a Meta or TikTok pixel with custom code?No. Wix says these “do not work through custom code.” Connect them in Marketing Integrations.
Can you add custom CSS?Wix Studio has a global.css file. The Wix Editor and Wix Harmony don’t, but a snippet can carry a style tag with limits.
Is code in a snippet private?No. Anyone can read it in the page source. Never put an API key or password in a snippet.
Will Wix support help if a snippet breaks?No. Wix “does not provide support for technical issues with third-party code snippets.” Contact whoever wrote the code.
What happens if you change the site’s domain?Wix deletes the snippets when you assign the site a new domain. Keep a copy of each one.

What are the ways to add code to a Wix site?

There are eight: Custom Code snippets, embed elements, the site verification and Advanced SEO tag fields, structured data markup, marketing integrations, custom CSS on Wix Studio, site code, and apps. Each is built for a different job, and this table puts them side by side.

MethodWhere you find itWhat it’s forEditorsPlan and setup
Custom Code snippetsDashboard: Settings > Custom CodeScripts, styles and tags loaded in the head or body of every page or chosen pagesAll editors, including HarmonyThe site must be published on a connected domain (so a Premium or Studio plan)
Embed HTML and Embed a siteEditor: Add Elements > Embed Code (Wix Editor); Add Elements > Embed & Social (Studio); + Add > Elements > Embed (Harmony)A visible widget or another web page shown in a box on the pageWix Editor, Wix Studio, Wix HarmonyNo plan requirement stated
Site verification and other head tagsDashboard: SEO & GEO > Site Verification; per page: SEO basics > Advanced SEOVerification meta tags for Google, Bing and others; extra link and meta tagsAll editorsThe Advanced SEO route is Wix’s documented option for free sites
Structured data markupPer page: Advanced SEO > Structured Data Markup; dashboard: SEO SettingsJSON-LD for rich resultsAll editorsNo plan requirement stated
Marketing IntegrationsDashboard: Marketing IntegrationsGoogle Analytics, Google Tag Manager, Google Ads, Meta Pixel and Conversions API, TikTok Pixel and othersSet in the dashboard, not the editorUpgraded site and connected domain
Custom CSS (global.css)Studio editor: Code panel > Page Code > global.cssStyling site elements with Wix’s CSS classesWix Studio onlyStudio site
Site code (JavaScript SDK and Velo)Wix Editor with Dev Mode on; Wix Studio code panel, Wix IDE or a local IDEFrontend and backend code with full access to Wix elements, data and business featuresWix Editor and Wix Studio; not HarmonyWorks on free sites with lower quotas; paid plans raise them
AppsWix’s developer tools (Wix CLI or self-managed), installed on the sitePackaged features, including private apps for one siteAll editors, with some extension types unavailable on HarmonyDeveloper account; the site owner installs the app

Sources for the table: About Custom Code, Embedding a Site or a Widget, Studio Editor: Adding an HTML iFrame Element, Harmony: Embedding a Link or HTML Code, Header Code Meta Tag Guidelines, Adding Structured Data Markup, About Marketing Integrations, Development Paths and Using Velo with a Free Wix Site.

Two of these routes are for developers rather than DIYers. Site code is how a developer adds custom features to a Wix Editor or Wix Studio site; Wix’s free-site page says you “can try out most Velo and Data features with a free site,” with quotas that a paid plan raises. Apps are the developer route for Harmony sites, where site code isn’t available. Wix Harmony and Custom Code: What a Developer Can Add Later covers which app types work on Harmony.

From here on, the guide covers the routes an owner can use alone: snippets, embeds, the SEO fields and marketing integrations.

What do you need before you can add custom code to Wix?

A published site on a connected domain, which in practice means a Premium or Studio plan.

Wix’s guide to embedding custom code asks you to make sure the site “is published and has a connected domain” before you start. A free wixsite.com address doesn’t qualify, and Wix’s page on assigning a domain says: “To connect your domain, you must upgrade your site.” So Settings > Custom Code is effectively a paid-plan feature.

Snippets are tied to the domain, too. In the same guide’s FAQ, Wix explains that snippets belong to a specific domain: “If you assign a different domain to your site, your code snippets will be deleted.” Extra domains that redirect to your main one don’t need their own copies, since all their traffic goes to the primary domain. If you’re about to change your primary domain, copy every snippet into a document first, along with its name, pages and placement.

On a free site, Wix documents one code route for verification: the Additional Tags field on a page’s Advanced SEO tab, described in Verifying Your Site On Search Engines Using Custom Code. That field takes tags, not scripts.

How do you add a custom code snippet on Wix?

The steps are the same in every editor, because snippets live in the dashboard, not the editor:

  1. Open your site’s dashboard and go to Settings, then Custom Code (under Development & integrations).
  2. Click + Add Custom Code and paste the snippet.
  3. Give it a name you’ll recognize later, such as the service and what it does (“Chat widget, Acme Support”).
  4. Under Add Code to Pages, choose All pages or Choose specific pages. With All pages you also decide whether the code loads a single time per visit or each time a visitor opens a page.
  5. Under Place Code in, choose Head, Body – start or Body – end.
  6. Click Apply, then check the published site.

Three of those choices need care.

Placement. Follow the provider’s instructions. Wix’s general advice is that tracking and verification code usually goes in the head and functional scripts in the body, but the provider’s documentation wins.

Once per visit, or every page. Wix offers this choice for snippets on all pages. Wix doesn’t spell out what “once per visit” means in technical terms, so if the provider gives no guidance, choose every page and test.

Code type. In the snippet’s Code Type tab you pick a category: essential, marketing, analytic or functional. Wix’s page on categorizing custom code says: “Custom codes are categorized as essential by default. This means that the code is loaded prior to visitor consent and cannot be disabled.” A marketing or analytics script left on the default runs before a visitor has answered your cookie banner, which defeats the banner. Wix states that categorizing correctly is the site owner’s responsibility. The category only has an effect when a consent banner is active: Wix’s cookie banner guide says that without one, “all cookies and scripts are loaded when a visitor first enters your site.”

A verification tag, for example, is a single line in the head:

<meta name="google-site-verification" content="your-code-from-search-console" />

Google Search Console checks for that tag on your homepage and, in Google’s words, “will periodically check for the presence of this tag,” so don’t delete it once you’re verified. On Wix you don’t need a snippet for it, though: the Site Verification tool under SEO & GEO takes tags for Google Search Console, Bing, Pinterest, Yandex and Naver and adds them to the homepage for you.

How do you embed HTML code on Wix?

Use an embed element when the code needs to show something in a set place on the page, such as a booking widget, a map from another service or a form. Wix’s custom code FAQ points to this element for visible code; Settings > Custom Code is for snippets that load in the background.

EditorWhere to find itSetup
Wix EditorAdd Elements > Embed Code > Popular Embeds, then Embed HTML or Embed a siteClick the element, then Enter Code or Enter Website Address. You can add alt text describing the embed.
Wix StudioAdd Elements > Embed & Social, then Embed Code or Embed SiteEnter Code for HTML, or Change Website Address for a page.
Wix Harmony+ Add > Elements, then Embed under More Options; drag Embed code or Embed a site onto the pageSettings icon on the action bar. Add an accessible name and choose the cookie category the code uses.

Sources: Wix Editor: Embedding a Site or a Widget, Studio Editor: Adding an HTML iFrame Element and Wix Harmony Editor: Embedding a Link or HTML Code.

The same rules apply in all three editors:

  • HTTPS only. The Wix Editor guide says “Only HTTPS codes and URLs are displayed.” An HTTP address shows nothing on the live site.
  • Some sites can’t be embedded. Sites that block embedding stay blank, and the Wix Editor guide says “it is not possible to bypass this within Wix.”
  • It’s an iframe. The element is a frame on your page, so its content won’t adapt to screen size even if it was built to, and a widget’s fixed pixel width and height can crop it. Wix suggests changing those values to 100% and sizing the element on the page instead.
  • Include everything the code needs. The Harmony guide warns that HTML often relies on separate CSS and JavaScript files, and the result may not look or work right unless the code references them.
  • No length limit. The Wix Editor guide says “There is no character limit for the HTML and Embed a Site elements.”

What can Wix custom code snippets do well?

Snippets are good at jobs that only need the browser: verification tags, chat widgets, consent banners, structured data, external fonts and small standalone scripts. Wix’s About Custom Code page lists these uses. They share one trait: the code works on its own in the browser and doesn’t need anything from Wix.

JobSnippet works?Better place on Wix, if there is one
Search engine verification tagsYesSite Verification tool, or a page’s Advanced SEO tags
Live chat widgets from support servicesYesCheck the Wix App Market for an official app first
Cookie consent banners from privacy servicesYesThe Usercentrics for Wix banner in Privacy & Cookies, if it covers your needs
JSON-LD structured dataYesA page’s Structured Data Markup field, or SEO Settings for whole page types
External fonts (a <link> tag)YesWix’s font tools, if the font is available there
Small scripts that don’t touch Wix elements, for example a countdown timer or a price calculatorYesAn Embed HTML element, if the script needs to show something in a specific spot
Showing data from a public API, such as live prices or weatherYes, if the API needs no secret keySite code, if a key is involved

Adding structured data (JSON-LD) on Wix

Structured data tells search engines what a page describes. Google’s introduction to structured data says “In general, Google recommends using JSON-LD for structured data if your site’s setup allows it,” and Wix’s Structured Data Markup field accepts JSON-LD only.

A small Organization block for a homepage looks like this:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Example Bakery",
  "url": "https://www.example.com",
  "logo": "https://www.example.com/logo.png",
  "sameAs": ["https://www.instagram.com/examplebakery"]
}
</script>

Google’s Organization documentation recommends placing this “on your home page, or a single page that describes your organization,” and says it has no required properties. Wix’s per-page markup field asks for the markup in JSON-LD format; if you use a Custom Code snippet instead, keep the script tags shown above and pick the homepage under Choose specific pages.

Before you add your own, check what Wix already adds. Wix’s structured data guide says it creates Local Business markup for the homepage once the site has a business name and location, and that some page types come with preset markup: Wix Blog posts, Wix Events pages, Wix Stores product pages and Wix Bookings service pages. The per-page field also has limits: markup “must be less than 7,000 characters,” and “You can add up to five markups per page.”

Two rules from Google’s general structured data guidelines apply wherever the markup lives. “Don’t mark up content that is not visible to readers of the page,” and valid markup still isn’t a promise: “Google does not guarantee that your structured data will show up in search results.” Test your page with Google’s Rich Results Test after publishing.

Why is my Wix custom code not working?

The causes Wix documents come down to a few things a snippet can’t do: run in the editor preview, reach Wix’s own elements or data, carry tracking scripts, or use browser features Wix now blocks. Work through these causes in order.

You’re looking in the editor. Wix’s developer docs say “Custom code doesn’t take effect in the editor and only runs on the published site.” Snippets also don’t show up as elements in the editor, so check the live site, ideally in a private browser window.

The snippet is in the wrong place or category. A script placed in the head when the provider asked for the end of the body, or loaded on specific pages when it needs all of them, may fail silently. A marketing or analytics snippet categorized correctly will wait for visitor consent, so it won’t run until you accept cookies in your own banner.

It’s a tracking script. Google Analytics, Google Tag Manager, and Meta and TikTok pixels don’t run from Settings > Custom Code. See the next section.

It depends on Wix’s page structure. Wix’s About Custom Code page lists the limits a DIYer runs into most:

  • No access to Wix APIs. A snippet can’t reach Wix page elements, CMS collections, backend code, or Stores, Bookings and Pricing Plans data. It only sees the page’s HTML and outside services.
  • No stable selectors. Wix creates element IDs and class names automatically, and code that targets them “may break when a site is re-published or updated.” A snippet copied from a forum that targets something like #comp-xyz123 works until Wix renames that ID.
  • Re-rendering. Wix’s rendering engine controls the layout and “may re-render elements in ways that conflict with direct DOM manipulation, especially during page transitions or viewport changes.” A script that moves or rewrites elements on load can see its changes undone when a visitor changes page or resizes the window.
  • Invisible to collaborators. Nobody editing the site sees the snippet, and Wix notes that “Other collaborators may not be aware of injected code.”

Wix’s security rules blocked it. The custom code guide’s FAQ says: “In December 2025, Wix introduced new frontend security measures for custom code on Wix sites.” Some snippets that worked before that change “may now be blocked until the provider updates them.” Wix’s frontend security page explains the rules: Wix swaps the browser’s built-in fetch and XMLHttpRequest for locked versions that code can’t replace, blocks access to Wix’s internal and security cookies, sandboxes iframes opened on the site’s own domain, and refuses timer calls (setTimeout, setInterval) that pass code as a string. Open your browser’s developer console on the live page and look for errors. If the problem is on the provider’s side, send them that page.

The embed can’t load. An embedded page or widget won’t appear if it uses HTTP or if the other site blocks embedding; see the embed section above. Links inside an embed often don’t work when they open a new browser tab or window, according to the Harmony embed guide.

One snippet breaks another. If something on the site misbehaves and you have several snippets, Wix’s advice is to switch them off one at a time with their toggles, testing the site after each, until the problem goes away.

Can you add Google Analytics, Tag Manager or a pixel to Wix with custom code?

No. Wix’s custom code guide says: “Tracking scripts such as Google Analytics, Google Tag Manager, and Facebook & TikTok pixels do not work through custom code.” Wix connects them through Marketing Integrations in the dashboard, where you paste an ID rather than code:

  • Google Analytics: connect a Google Tag and enter your GA4 measurement ID, following Wix’s Google Analytics guide.
  • Google Tag Manager: enter the ID from your Tag Manager account, per Wix’s Tag Manager guide.
  • Meta Pixel and Conversions API: connect your Meta account through Wix’s Meta integration, which sends events from Wix’s servers as well as the browser.
  • TikTok Pixel, Google Ads conversions and others: listed on Wix’s About Marketing Integrations page.

Each integration needs an upgraded site and a connected domain. Wix also warns: “Avoid installing Google Tag and Google Tag Manager together, as they may conflict with each other.” Pick one.

Expect lower numbers once a cookie banner is in place. Wix’s Google Analytics guide says that with a banner, Analytics “will only gather data after a visitor provides consent and approves using the relevant cookies.” That’s the integration working as intended, not a fault.

Can you use custom CSS on Wix?

It depends on the editor.

EditorCustom CSS option
Wix StudioYes. A global.css file in the Code panel, plus a CSS Classes panel for picking an element’s classes or adding your own. Wix’s Studio CSS guide says CSS in that file “overrides selections you make in other panels in the editor.”
Wix EditorNo stylesheet access. Wix’s feature request page says “Currently, it is not possible to access the CSS code of your site.” A <style> tag in a Custom Code snippet is the workaround.
Wix HarmonyNo. Wix’s About Wix Harmony page lists custom CSS among the features Harmony doesn’t have. A <style> snippet is the workaround here too.

Wix’s Development Paths page is explicit: “CSS styling via global.css and a per-element CSS Classes panel is only available in Wix Studio.” (Wix’s About Custom CSS page lists the Wix Editor among the tools that can edit CSS, but the Development Paths page, the Velo styling reference and the Help Center’s Wix Editor request page all point to Studio only.)

The Studio route is the reliable one, because Wix supplies named classes such as .button and .button__label that stay put. A <style> snippet on the Wix Editor or Harmony is safer when it targets plain elements such as h1, p and a, as Wix’s custom code docs suggest, than when it targets Wix’s generated class names and IDs, which can change on the next publish.

Is custom code on Wix secure?

The code is public. Wix’s developer docs say a snippet “is visible to anyone who views the page source or uses browser developer tools,” and give a plain rule: “Don’t include API keys, passwords, or other sensitive data in custom code snippets.”

Some providers issue an ID or a publishable key that is meant to sit in the page, such as a chat widget’s site ID, and their instructions say so. A secret key that lets someone charge a card, send email from your account, read your customer list or use a paid API on your bill is not. If an integration’s instructions ask you to put a secret key in your page, it needs server-side code. On Wix that means site code on a Wix Editor or Studio site, which can keep keys in Wix’s Secrets Manager instead of in the code, or an app.

A script on your page can also change the page and read what visitors type into its forms, so add code only from providers you would trust with your customers’ details, and remove snippets for services you no longer use.

Does custom code slow down a Wix site?

It can. Wix’s performance guide says third-party apps and iframes load from outside servers, and “This means Wix cannot optimize them.” The same page advises keeping third-party code to what the site really needs and connecting analytics and ad tools through marketing integrations, and its FAQ lists limiting custom code and third-party apps among the fixes for a slow Largest Contentful Paint.

In practice:

  • Load a snippet only on the pages that need it. A booking widget doesn’t need to load on your blog.
  • Keep heavy embeds, such as social feeds, off the homepage.
  • Check the Site Speed dashboard after adding a snippet. Wix points owners of slow sites there for specific insights.

Who supports custom code on Wix?

The provider who wrote it, or you. Wix’s custom code guide says “Wix does not provide support for technical issues with third-party code snippets,” and the embed guides say the same about code in Embed HTML elements. Structured data is in the same position: Wix says “Wix Customer Care cannot help you with any changes to your markup.”

Keep your own record: for each snippet, note what it does, who provided it, where it’s placed, which pages it loads on, its code type, and the date you added it. Wix doesn’t document a limit on the number or size of snippets in Settings > Custom Code, and the dashboard list shows only the names you gave them, so a record is how you’ll know later what each one does and whether it’s safe to remove.

Is a snippet the right tool? A Wix decision table

What you want to doUse
Verify the site with Google, Bing or PinterestSite Verification tool
Add Google Analytics, Tag Manager, a Meta pixel or a TikTok pixelMarketing Integrations
Add JSON-LD to a page or page typeStructured Data Markup in SEO settings; a snippet for markup the fields can’t hold
Add a chat widget or consent banner from an outside serviceA Custom Code snippet, categorized correctly (or the provider’s Wix app, if it has one)
Show a widget in a specific spot on a pageAn Embed HTML element
Restyle elements beyond the editor’s optionsglobal.css on Wix Studio; a careful <style> snippet elsewhere
Read or change Wix data (products, bookings, members, CMS items)Site code on a Wix Editor or Studio site, or an app
Call an outside service with a secret keySite code or an app, never a snippet
Run something on a schedule or when an order or booking comes inSite code or an app

When has a Wix site outgrown snippets?

Snippets reach their limit at three points:

  1. Backend logic. Something has to happen on a server: a quote calculated from your price list and saved, a booking checked against custom rules, orders copied into your accounting software. Wix’s docs say plainly that snippets have “No backend execution.”
  2. Secrets. The integration needs a private key.
  3. Your data. The feature needs to read or write Wix’s own records, such as products, orders, members or CMS collections.

When you hit one of those, there are three realistic routes.

RouteBest whenWhat’s involved
Site code on the Wix Editor or Wix StudioThe site is on one of those editors and staying on Wix suits youA developer writes frontend and backend code with the JavaScript SDK (and Velo where needed), with full access to Wix’s elements, data and business features.
An appThe site is on Harmony, or the feature should stay separate from the site’s pagesA developer builds a Wix app, which can be private to your site. See Wix Harmony and Custom Code for what Harmony supports.
A move to another platformThe workarounds keep growing, or you want code you own on a host you pickRebuilding the site and moving its content. Outgrown Squarespace or Wix? Signs and What Moving Involves covers the decision, and Wix to WordPress Migration: Content, Products and Redirects covers the move item by item.

On WordPress, the equivalent decision is where code belongs: a plugin, the theme or functions.php. Plugin, Theme or functions.php? Where WordPress Code Belongs explains it, and the general idea of extending a platform through its intended extension points is set out in Website Platforms You Can Start Without Code and Extend Later.

A handful of snippets you can account for are fine on any platform. The warning sign is a site whose important features depend on pasted code that nobody at Wix will support and nobody on your team fully understands.

Next step: audit your Wix snippets

Open Settings > Custom Code and write down every snippet: what it does, who provided it, its pages, placement and code type. Move anything that has a built-in home (verification, analytics, pixels, structured data) to that home, fix the code types on marketing and analytics scripts, and delete what you no longer use. If what’s left includes anything that needs a server, a secret or your Wix data, that’s the feature to plan properly.

If you’d like help, see custom WordPress plugins and themes. The process and pricing are published, and you can get in touch to talk through what your site needs next.

RSS Feed Newsletter
Contact us

Latest Blog Posts