Features & Functionality

How can I add HTML code to my Wix website?

Adding HTML Code to Your Wix Site

Adding custom HTML code to your Wix website is straightforward using the built-in Embed Code element. This feature allows you to integrate custom code snippets, third-party widgets, and interactive elements into your site.

Step-by-Step Process

Access the Editor Start by opening your Wix dashboard and selecting the site you want to edit. Click Edit Site to launch the Wix Editor where you'll make your changes.

Add the Embed Element On the left side of the editor, click the Plus icon (+) to open the elements panel. Scroll down to find the Embed section and choose either Embed a Widget or Embed Code, depending on your editor version.

Insert Your HTML Select Embed HTML to open the HTML Settings box. Paste your raw HTML or embed code directly into this field. You can include standard HTML tags, CSS styling, and even JavaScript within your code snippet.

Position and Publish Once you've added your code, close the settings box. The embedded element will appear on your page where you can resize and reposition it as needed. Preview your site to ensure everything displays correctly, then publish to make it live.

Advanced Integration Options

For interactive HTML that needs to communicate with other Wix elements, Wix provides the postMessage and onMessage APIs through their Velo development platform. This enables two-way communication between your embedded HTML iframe and your Wix page code, allowing for dynamic interactions like triggering navigation or updating content.

For even more advanced customization, consider using Wix Blocks to create fully custom elements with integrated logic that seamlessly blend with your Wix environment.

The Embed Code method works for most common use cases, from simple HTML snippets to complex third-party integrations, giving you the flexibility to extend your Wix site's functionality beyond standard elements.

For more information about embedding code, visit the Wix Help Center.