Knowledge Base

Get Expert Website Hosting

Choose website reliability and expertise with SiteGround!

Home / Website Builder / Pages & Content Editing / How to use the Code component

How to use the Code component

Summarize this article with:
Last update: Sep 21, 2026 • 1 min read

Website Builder offers a wide range of components that can add various features to extend your pages’ functionality. However, you may go one step further and add custom code components to embed third-party apps, JavaScript, CSS, Markdown, or HTML that can give your website a unique design and tools.

Here is how you can do that:

  1. Open the Pages section and select an existing page or create a new one with the Add New button.
    Pages section in Website Builder where you can select an existing page or use Add New to build a new page


  2. Hover over the section where you’ll add the component and press the + ADD button in the top-left corner to open the Add Component window.
    A selected page section in Website Builder where the Add button to add a component is highlighted
  3. Search for/select the Code component.
    The Add Component window on a page in Website Builder where you can select the Code component
  4. Click and hold the component’s box to activate the section’s grid view. Then, move the box to your preferred position and release it.
    Grid view for a Website Builder section where you can change a component position
  5. Click the component and select the pencil icon (Edit) from the toolbar above.
    A component toolbar which appears when a component is selected. The Edit (pencil) icon is selected
  6. A new Edit Code window will open where you can write or paste your custom code.
    A code component in Website Builder where you can see the code and the visual design
  7. If the code is too large and you need more workspace, press the Expand icon in the lower-right corner.
    A code component in Website Builder with a highlighted Expand button to increase the workspace area
  8. To go back to the standard view, close the Edit Code window.
    An expanded workspace of a code component
  9. Use the Display Source Code toggle to switch between code view and output view in the component block.
    Code component with a Display Source Code toogle switched on that displays either the code or the output in the component box

IMPORTANT! Custom code scripts are not executing while you are inside Website Builder. To run them, open the page in Preview mode.

Share this article

Found this article useful?

Add SiteGround to your preferred Google sources