September 25, 2026
How to Gate Content on Squarespace
Squarespace makes it easy to collect newsletter signups, but it doesn't have a way to keep a guide, a checklist or a PDF hidden until someone enters their email. You can add that by embedding a gated page in a Squarespace code block. Visitors see your preview on your own page, fill in the form, and the full content or the PDF download appears right there.
Check your Squarespace plan first
This is the step most people skip. The Gatedleads embed code contains an iframe and a short script, and Squarespace's code block documentation says adding JavaScript or iframes to code blocks is only available on the Core, Plus, Advanced, Business and Commerce plans. On other plans, code blocks still accept plain HTML, but not the script this embed relies on.
Embedding is also a Gatedleads Pro feature. If either plan doesn't fit, use the free alternative at the end of this post.
Step 1: Build the gated page
Create the page in Gatedleads with a headline, a short preview, the gate, and the content that appears after someone signs up. For a PDF, upload it as a file block so it downloads once the email is in. Starting from a template saves time, and you only need the content, since the page will sit inside your Squarespace design.
Publish it and test it on its own link first.
Step 2: Copy the embed code
In the Gatedleads page editor's settings, open Embed on your site and click Copy embed code. The snippet loads your page into an iframe, resizes it to fit the content, passes any UTM tags on your Squarespace URL through to Gatedleads, and records your Squarespace page as the traffic source.
Step 3: Add a code block in Squarespace
Following Squarespace's steps:
- Edit the page or blog post where the gated content should go.
- Hover over the section and click Add block or + to open the block menu.
- Click Code.
- Click the pencil icon to open the editor.
- Make sure the dropdown is set to HTML, then paste the full snippet.
- Leave Display Source off. That toggle shows code as text, which you don't want here.
Save the page. Squarespace notes that JavaScript in a code block only renders when the block is set to HTML, so if you see the code printed on the page, check that dropdown.
Step 4: Test it logged out
Squarespace's documentation warns that as a security measure, code blocks with scripts sometimes don't display while you're logged in, even when visitors can see them. So a blank block in the editor doesn't necessarily mean anything is wrong.
Squarespace suggests the Preview in Safe Mode button for checking embedded code. The most reliable test is to open the live page in a private browser window, where you're not logged in, submit a test email, and confirm the gated content or PDF appears. Then check the lead in your Gatedleads dashboard, with the Squarespace page as its source.
Placement tips
- Put it next to the content that sells it. A code block after the paragraph that explains why the guide is useful gets more signups than one at the bottom of a long page.
- Give it a full-width section on mobile. The embed fills the width of the block and grows to fit its content, so it doesn't need a fixed height.
- Use one embed per page. Two gated forms on the same page split attention and make your source data harder to read.
The free alternative: link to the gated page
On the Gatedleads free plan, or a Squarespace plan without JavaScript in code blocks, publish the gated page on its own link and add a Squarespace Button block pointing to it. Visitors go to the Gatedleads page for the one step of entering their email, and everything else works the same, including the gated content, PDF delivery and lead tracking.
How to gate content without code explains this standalone setup and when it's the better choice anyway.
Using another platform?
The same embed code works on other site builders, with different steps and requirements. See how to gate content on WordPress and how to gate content on Webflow.
FAQ
Can I use a Squarespace Embed block instead of a code block?
This post uses the code block because that's where Squarespace documents support for custom HTML, JavaScript and iframes. If you'd rather try the Embed block, check Squarespace's Embed blocks guide for what it accepts on your plan.
Does this replace my Squarespace newsletter block?
It doesn't have to. A newsletter block collects signups for ongoing emails. The gated page delivers a specific resource in exchange for the email. Many sites use both.
Will the leads go into Squarespace Email Campaigns?
Not automatically. Leads are stored in Gatedleads. You can export them as a CSV and import that into your email tool, or on Pro send each new lead on through Zapier.
Why is the code block blank when I'm editing?
Probably the logged-in security behavior Squarespace describes. Check the live page in a private window before changing anything.
Create your gated page free, or see how Gatedleads works first.