How To Add HTML Code on Wix (3 Methods)

How To Add HTML Code on Wix (3 Methods)

To add HTML code on a Wix website, open the editor, click the "+" button on the left toolbar, go to "Embed & Social," select "Custom Embeds," and choose "Embed a Widget." Paste your HTML into the code box and click "Update." That is the fastest method, but Wix actually offers three different ways to add custom code depending on what you need.

This guide walks through each method step by step, with real examples you can copy, a breakdown of Wix's HTML limitations, and fixes for common problems.

Method 1: Add HTML With the Embed a Widget Element

The Embed a Widget element is the most common way to add HTML code on Wix. It places a sandboxed iframe on your page where custom HTML, CSS, and JavaScript run independently from the rest of your site. This is the right choice for embedding maps, forms, third-party widgets, or any self-contained HTML block. One of the most common uses is embedding YouTube videos on Wix using iframe code.

Step 1: Log Into Your Wix Account and Open the Editor

How To Add HTML Code On Wix - Log into Wix either by email or different social media platforms such as Facebook, Google or as a guest

Go to Wix.com and sign in. From your dashboard, select the site you want to edit and click "Edit Site" to open the Wix Editor. If you are new to the platform, you can follow our full guide to designing a website with Wix first.

Step 2: Add the Embed a Widget Element

How To Add HTML Code On Wix - On the menu bar, click on the Embed and Social button to add your custom code

Click the "+" icon on the left-side toolbar. In the menu that opens, select "Embed & Social," then "Custom Embeds," and finally "Embed a Widget." A placeholder box will appear on your page. Drag it to the position where you want your HTML content to show up.

Step 3: Paste Your HTML Code

How To Add HTML Code On Wix - Once the place marker appears, you can now enter your custom code

Click the widget, then click "Enter Code." The code editor panel opens. Select "HTML" from the code type dropdown (you can also choose "URL" if you want to embed a page by its web address). Paste or type your HTML. Here is a simple example that embeds a Google Map:

You can include inline CSS within a

Show More

* read the rest of the post and open up an offer
FAQs

Yes, there are several important limitations. The Embed a Widget element runs your code inside a sandboxed iframe, so your HTML and JavaScript cannot access or modify other Wix page elements outside that iframe. All external resources must load over HTTPS or the browser will block them. Server-side code is not supported in the widget; for backend logic, you need Wix Velo. Some custom code features, including site-wide code injection, require a paid Wix plan.

Content inside the Embed a Widget element loads in an iframe, which means search engines may not crawl or index that content as part of your page. For SEO-critical text, it is better to use native text elements or Velo rather than embedding it in an HTML widget. Adding well-optimized tracking scripts through site-wide code injection has no negative SEO impact. Poorly written or heavy scripts can slow down page load times, which does hurt SEO, so always minimize your code and load scripts asynchronously when possible.

Yes. Go to your Wix Dashboard, open Settings, and select Custom Code. Click Add Custom Code, paste your snippet, and choose Head to inject it into the header or Body - end for the footer area. You can also choose whether the code runs on all pages or only specific ones. This is the recommended method for tracking scripts, analytics tags, chat widgets, and any code that should load globally across your site. Note that this feature requires a Wix Premium plan.

Top