# CMS: Connecting HTML Widgets to the CMS

Source: https://support.wix.com/en/article/cms-connecting-embed-code-widgets-to-the-cms (updated 2026-11-16)
Related: Wix developer documentation, https://dev.wix.com/docs/llms.txt; Help Center index, https://support.wix.com/en/llms.txt

Connect HTML widgets (iFrames) to a [dataset](https://support.wix.com/en/article/cms-about-datasets) to display external websites (URLs) for each item in your CMS collection.

  
 This is useful for displaying dynamic content like different event pages, partner websites, or portfolios where the website address changes for each item in your collection.

> **Note:** Currently, you can only connect the element to a collection field that contains a URL. It is not possible to connect raw HTML code (e.g. <iframe src...>) from the CMS.You can [vote for this feature here](https://support.wix.com/en/article/cms-request-linking-cms-to-html-embed-elements-on-dynamic-pages).

---

## Connecting an HTML widget to a dataset

Select an embed code element in your editor and connect it to a dataset. Then choose whether to display HTML code or a website address (URL) from your collection fields.

  
 Select the HTML widget in your editor and connect it to a dataset that connects to your CMS collection. Then choose the URL or Text field that contains the website address you want to display.

> **Note:** In the Wix Harmony Editor, you can't connect HTML widgets to your collection. You can connect text, image, and button elements, and connect galleries to 'Media Gallery' fields. You can [vote to connect more element types in Wix Harmony](https://support.wix.com/en/article/wix-harmony-editor-feature-request-connecting-additional-element-types-to-your-collection-2).

**Wix Editor:**

1. [Go to the relevant page in your editor](https://manage.wix.com/account/site-selector/?actionUrl=https%3A%2F%2Fwww.wix.com%2Feditor%2F%7BmetaSiteId%7D%3FeditorSessionId%3D%7Besi%7D%26).
2. Add the embed a site element to your page:  
   1. Click **Add Elements** ![](https://d2x3xhvgiqkx42.cloudfront.net/65d5031a-8d20-483c-b08f-0a758e1cf2fd/68a0236f-77f4-43c6-931f-8298ae691a9e/2022/11/17/01f24c8b-2ea3-4d06-a26d-9975a43d617e/a79e245b-4870-4444-ba82-248eca4eb9a7.png) on the left side of the editor.  
   2. Click **Embed Code**.  
   3. Click the **Embed a site** element to add it to your page.
3. Click the **Connect to CMS** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/06/16/2d484f5d-e1bf-4d48-9e42-82216e8b88de/08e74518-edad-42f8-b007-c974ba767eb6.png) .
4. Click the **Choose a dataset** drop-down and select an existing dataset that connects to your collection. Alternatively, select **Add a Dataset**, then choose the collection you want to connect, give the dataset a name and click **Create**.
5. Click the **HTML connects to** drop-down and select the relevant field from your collection:  
**Tip:** Select **+ Add** to create and connect a [new 'URL' or 'Text' collection field](https://support.wix.com/en/article/cms-formerly-content-manager-adding-a-field-to-a-collection).  
   * **URL:** (Recommended)Select the 'URL' field containing the HTTPS address you want to display.  
   * **Text:** Select a 'Text' field containing a valid HTTPS URL.  
   **Note:** This field must contain a URL only. Raw HTML code is not supported.

![Screenshot of connecting the embed code element to URL field.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2026/01/06/02ec9d0b-b718-41d6-bc57-c88b4ca21e26/342ea451-7662-4b14-a70a-f90a6486152b.png)

1. (If needed) Click and drag the borders of the element to resize it.
2. Click **Preview** to test your connections.
3. Click **Publish** if you are ready to make the changes go live.

**Studio Editor:**

1. [Go to the relevant page in your editor](https://manage.wix.com/account/site-selector/?actionUrl=https%3A%2F%2Fwww.wix.com%2Feditor%2F%7BmetaSiteId%7D%3FeditorSessionId%3D%7Besi%7D%26).
2. Add an embed code element to your page:  
   1. Click **Add Elements** ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/8696077d-830a-4b1e-bd86-9df98f89994a/2023/06/14/cef22a14-dfc9-43c7-a54f-72ed83266050/741248d2-4240-497e-a282-2a7d15d8afac.png) on the left side of the editor.  
   2. Click **Embed & Social**.  
   3. Click the **Embed Site** element to add it to the page.
3. Click the **Connect to CMS** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2023/06/16/2d484f5d-e1bf-4d48-9e42-82216e8b88de/08e74518-edad-42f8-b007-c974ba767eb6.png) on the element.
4. Click the **Choose a dataset** drop-down and select an existing dataset that connects to your collection. Alternatively, select **Add a Dataset**, then choose the collection you want to connect, give the dataset a name and click **Create**.
5. Click the **HTML connects to** drop-down and select the relevant field from your collection:  
**Tip:** Select **+ Add** to create and connect a [new 'URL' or 'Text' collection field](https://support.wix.com/en/article/cms-formerly-content-manager-adding-a-field-to-a-collection).  
   * **URL:** (Recommended)Select the 'URL' field containing the HTTPS address you want to display.  
   * **Text:** Select a 'Text' field containing a valid HTTPS URL.  
   **Note:** This field must contain a URL only. Raw HTML code is not supported.

![Screenshot of connecting the embed code element to a URL field.](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/d6b40156-9694-4cfe-9209-54815ef9d6dc/2026/01/06/0517d14f-8601-4b56-b907-441e0232f9ea/fcc63bf3-75e6-4380-a747-98574cebe2c9.png)

1. (If needed) Click and drag the borders of the element to resize it.
2. Click the **Preview** icon ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/8696077d-830a-4b1e-bd86-9df98f89994a/2023/07/12/45e03e4e-437b-4067-977e-869c3ff1ddd7/357065e4-6113-4838-9dbd-edc880533773.png) at the top right to test your connections.
3. Click **Publish** if you are ready to make the changes go live.

---

## FAQs

Click below for answers to common questions about connecting embed code widgets.

**Can I connect raw HTML code from my collection?**

No. Currently, you can only connect a field that contains a valid URL (web address). If you connect a Text field containing HTML tags (e.g. <iframe src...>), the code will not verify or render.

**Can I connect an HTTP URL?**

No. To ensure your site remains secure, Wix only supports **HTTPS** URLs for embedded content.

**Why does my embedded site show a refused to connect error?**

Some websites have security settings (X-Frame-Options) that prevent them from being embedded in an iframe on other sites. If you see a "refused to connect" error, it means the external site does not allow embedding.

**Why isn't my content displaying?**

If your content isn't showing:

* **Check the field type**: Ensure you are connecting to a **Text** or **URL** field.
* **Check the URL**: If using a URL, make sure it starts with **https://** (http is not supported).
* **Check the code**: If using a Text field, ensure it contains a URL only, not raw HTML code strings.

**Is the embedded content secure?**

Yes. Wix uses specific sandboxing attributes for embedded code to ensure your site remains secure. However, always ensure you trust the source of the code or URL you are embedding.

**Can I filter the content displayed?**

Yes. You can filter the content by [adding filters to the connected dataset](https://support.wix.com/en/article/cms-displaying-content-from-multiple-collections-using-datasets). For example, if you only want to show embed codes for items marked "Active", you can add a filter to your dataset to exclude other items.

**What is a dataset?**

Datasets are the vital link between the elements on your page and the content in your CMS collection. You can use datasets to create a two-way connection, allowing you to display collection content, capture user inputs, or both. 

  
 Datasets allow you to control which parts of your page elements connect to which fields in your collection. Each dataset connects to a collection and each element connected to the dataset connects to a field in the collection. This unlocks a new way of managing which content appears and where.

  
 Learn more about [adding and setting up a dataset](https://support.wix.com/en/article/cms-formerly-content-manager-adding-and-setting-up-a-dataset).
