How to Add HTML to Squarespace
Adding custom HTML to your Squarespace website is not only possible, it's a great way to take your site beyond its default design and functionality. While some might say Squarespace is limited, the truth is, with a little code, you can unlock far more potential than most people realize.
In this quick guide, I’ll show you all the different ways to add HTML to Squarespace, whether you want to insert code into your header, footer, individual pages, or use it for custom blocks.
Can You Add HTML to Squarespace?
Yes, and you absolutely should if you're looking to customize your website beyond what’s available in the drag-and-drop editor. Whether you're embedding third-party tools, adding tracking scripts, or enhancing your design with custom elements, HTML gives you the flexibility you need.
Note: You’ll need a Business plan or higher to use some HTML features, like code injection and embedded scripts.
Want a framework for designing the perfect homepage?
Need an expert to build your Squarespace website?
Book a free kick-off call with our team to discuss your project requirements in detail.
Where to Add HTML in Squarespace
Here’s a complete breakdown of where and how you can add HTML on your Squarespace website:
1. Header and Footer Code Injection
This is one of the most common places to add HTML, especially for:
Meta tags
Google Analytics
Facebook Pixel
Custom CSS or JavaScript
How to Add HTML to the Header or Footer:
Go to Settings > Advanced > Code Injection
Paste your HTML or JavaScript into the Header or Footer section
Save your changes
You can also add HTML to:
Order Confirmation Page
Order Status Page
These are useful for eCommerce tracking and post-purchase scripts.
2. On-Page HTML (Using Blocks)
If you want to add HTML to a specific section of a page, Squarespace gives you a few block options when editing a section.
Options include:
Embed Block - Useful for embedding third-party media (like YouTube or SoundCloud). You can paste a URL, but this doesn't support full HTML.
Code Block - This is where you can paste raw HTML, JavaScript, or CSS. You can also change the display mode if needed.
Markdown Block - Great for developers who want to mix Markdown formatting with some HTML.
How to Add HTML via Blocks:
Click Edit on a page section
Click Add Block
Choose either:
Embed
Code
Markdown
Paste your code
Save
3. Page-Specific HTML (Advanced Settings)
Want to insert HTML only on a specific page? You can do that through the page’s settings.
Two ways to do this:
While editing the page, click Settings > Advanced > Page Header Code Injection
Or, from Pages, click the Settings cog next to the page name then head to Advanced and Paste your HTML in the Header section
This is perfect for scripts or meta tags that should only apply to one page.
Final Thoughts
Whether you’re adding custom forms, tracking scripts, or unique design elements, knowing how to use HTML in Squarespace opens up a world of possibilities. With multiple options across your entire site, you’re never stuck with default functionality.