header-logo
Getting started with WixBuild your website and business with Wix. Try using our AI tools to create your website, customize templates, or hire professionals to build or enhance your online presence.
Creating a websiteRead how to use the Wix Editor and manage content on your site. Discover how to protect your visitors' privacy and make your site accessible.
Account & billingReview your account settings, manage your subscriptions and plans and understand your invoices.
Using the Wix mobile appsUse our mobile apps to run your business efficiently on the go and set up a dedicated app for your site members to stay in touch.
Connecting a domainFollow our step-by step guides to learn how to purchase, connect or transfer a domain for your site, and find out how to keep your site’s data secure.
Managing your businessGet tools to grow your business and web presence. Find the right tools for your specific needs, set up online payments and keep track of your site's analytics.
Promoting your siteLearn to make your site more visible promoting it on search engines, sending emails and running paid ads. Improve your online presence with practical tips.
Studio, Partners & EnterpriseGet the most out of your Studio or Enterprise account with advanced features that'll help you work more efficiently.
Need more help?Find solutions for site performance and technical issues, learn about issues we’re working to fix or contact us for help.
placeholder-preview-image
Wix LearnImprove your skills with our courses and tutorials.
Wix BlogGet tips for web design, marketing and more.
SEO Learning HubLearn to increase organic site traffic from search engines.
Website developmentBuild a custom site using our full-stack platform.
Hire a ProfessionalGet matched with a specialist to help you reach your goals.
placeholder-preview-image
In this article
  • Adding custom behavior with AI
  • Reverting code changes done by AI
  • FAQs

Studio Editor: Using the AI Assistant to Add Custom Code

In this article
  • Adding custom behavior with AI
  • Reverting code changes done by AI
  • FAQs
Currently, this feature is in alpha mode.
Add custom code behaviors to elements, without any coding experience, using our AI assistant. Whether you're enhancing interactivity or creating tailored experiences, AI makes it simple. Focus on your creative vision while the assistant handles the technical coding, offering suggestions or implementing your own ideas.
excerpt from a conversation with the AI assistant after it generated custom code, disabling a button for visitors in germany

Adding custom behavior with AI

Access the AI assistant from the Code panel, or right-click the specific element you want to customize. The assistant will send an initial message on your behalf – ‘What interactive behavior can you apply to (element ID)?’— and offer tailored suggestions based on the element.
Pick a suggested behavior or describe the customization you have in mind. You’ll always have the chance to preview and approve the code before it’s added to your client’s site.

To add custom behavior with AI:

  1. Go to your editor.
  2. Right-click the relevant element.
  3. Select Add Custom Behavior with AI.
    Tip: This opens the chat with the AI assistant (within the Code panel) on the left side of the editor. 
  4. Review the AI assistant's suggestions for custom behaviors it can add.
  5. Describe what you want to customize and click the Send icon .
    Tip: It doesn't have to be one of the suggestions if you had a different idea in mind. The AI assistant will evaluate and advise if it can add the customization you're thinking of. 
  6. Choose what to do next:
    • Refine the customization: Continue chatting to the AI assistant to clarify the specific customization you want it to add. 
    • Preview the code: Click Show code to see the code AI intends to add. It also provides a breakdown of what the code does, clarifying how it applies the customization. 
    • Add the code: Add the code to your client's site.
      1. Click Add code.  
      2. Click Approve to confirm adding the code.
What's next?
  • Click Preview under Generated Code to see how your customization looks. 
  • You can always click the New Chat icon  to start a conversation about another customization you want AI to make.  
Conversation with the AI assistant, showing the end where it generated code that disables a button for visitors from germany

Reverting code changes done by AI

Restore your client's site to its previous state if you want to undo changes made by the AI assistant. You can access your chat history with the assistant and revert any generated code back to an earlier version.

To restore the code to the previous state:

  1. Go to your editor.
  2. Click Code undefined on the left side of the editor.
  3. Click AI Assistant
  4. Click the More Actions icon  at the top right of the code panel.
  5. Select Show chat history.
the AI assistant in the code panel, cursor clicking the more actions icon and selecting the 'show chat history' option
  1. Select the relevant conversation.
  2. Click Restore under the relevant Generated Code section.
Part of a previous chat with the AI assistant, showing the generated code section and the restore button

FAQs

Click a question below to learn more.

Helpmate

Hello

Need a bit more guidance?
Unlock personalized helpLog in to get the most out of Helpmate.