September 25, 2026

How to Gate Content on WordPress (Without a Membership Plugin)

If you want to trade a guide, a checklist or a PDF for an email address on a WordPress site, you don't need a membership plugin. Membership plugins are built for something bigger: user accounts, passwords, paid tiers, content locked for logged-in members. For a lead magnet, all you need is a form that reveals the content once someone enters their email, placed where your readers already are.

The approach below keeps WordPress exactly as it is. You build the gated page in Gatedleads, then drop it into any post or page with WordPress's own Custom HTML block.

Why a membership plugin is the wrong tool for a lead magnet

A membership plugin asks every reader to create an account before they see anything, which is a much bigger ask than an email address. It also adds user management, login pages and extra database tables to your site, and one more plugin to keep updated. That's worth it if you sell memberships. For a single gated guide it's a lot of machinery for a small job.

An embedded gated page does the smaller job directly. The reader sees a preview, enters their email, and the rest of the content appears in the same spot on your post. No account and no password to remember.

Before you start: what your WordPress setup needs

The Gatedleads embed code is an <iframe> followed by a short <script>. WordPress only keeps those tags for certain accounts and plans, so check this first.

  • WordPress.com: according to the WordPress.com Custom HTML block guide, tags including iframe and script need a paid plan with hosting features activated. On the free plan, or before hosting features are active, WordPress.com strips them and your code "disappears after saving."
  • Self-hosted WordPress (WordPress.org): the Custom HTML block documentation explains that users without the unfiltered_html capability have disallowed tags such as <script> and <iframe> removed when the post is saved. Which roles have that capability is covered in WordPress roles and capabilities. If you run the site yourself as an administrator, you usually have it. If someone else manages your site, ask them.

On the Gatedleads side, embedding is a Pro feature. If you're on the free plan, skip to the free alternative further down.

Step 1: Build the gated page in Gatedleads

Create the page as you normally would: a headline, the preview blocks visitors see before the form, the gate, and the content that appears after someone signs up. If your lead magnet is a PDF, upload it as a file block so it downloads once the email is in. Starting from a template (checklist, cheat sheet, ebook or guide, and others) saves most of the layout work.

Publish the page and check it works on its own link first. It's easier to fix content there than inside WordPress.

Step 2: Copy the embed code

In the page editor's settings, find Embed on your site and click Copy embed code. The snippet resizes itself to fit the content, passes any UTM tags on your WordPress URL through to Gatedleads, and records your WordPress page as the traffic source, so your analytics show which post drove each signup.

Step 3: Add a Custom HTML block in WordPress

Following the WordPress documentation:

  1. Open the post or page where the gated content should appear.
  2. Click the Block Inserter and search for "HTML", or type /html in a new paragraph and press Enter.
  3. Select the Custom HTML block.
  4. Click Edit HTML, paste the full snippet, then click Update.
  5. Update or publish the post.

Paste the snippet exactly as copied, iframe and script together. The script is what loads the page into the iframe, so if it's removed, the block stays blank.

Step 4: Check it on the live post

Open the published post in a private browser window, where you're not logged in to WordPress. You should see your preview content and the form. Submit a test email to confirm the gated content or PDF appears, then check the lead showed up in Gatedleads.

If the embed is blank

Almost every blank embed comes down to one of these:

  • The script was stripped. Reopen the block and see whether the <script> part is still there. If it's gone, it's the plan or capability issue described above.
  • A performance plugin is delaying JavaScript. Some caching and optimization plugins defer or combine inline scripts. If yours does, exclude this snippet from that setting.
  • You're checking the editor preview. Look at the published post instead.

The free alternative: link to the gated page

On the free plan you can still gate content for WordPress readers. Publish the gated page on its own Gatedleads link, then add a Button block or a plain link in your post pointing to it, ideally right after the paragraph that makes the resource relevant. Readers leave your site for one step, but the content, the form and the lead capture all work the same way.

That's also the setup described in how to gate content without code, which covers keeping an article on your own site and gating only the deeper resource.

Using another site builder?

The same embed works on other platforms, but where you paste it and what plan you need differ. See how to gate content on Webflow and how to gate content on Squarespace.

FAQ

Does the gated content live on my WordPress site?

No. The page, the form and the leads are stored in Gatedleads and shown inside your post through the embed. Your WordPress database doesn't change.

Will this slow my WordPress site down?

The embed loads one iframe. It doesn't add a plugin, database tables or anything that runs on your server.

Can I embed it in a sidebar or widget area?

Anywhere WordPress accepts a Custom HTML block should work, with the same plan and capability requirements. Most gated content converts better inside the post, next to the paragraph that makes it relevant.

Can I gate the WordPress post itself instead of a separate resource?

Put the part you want gated into the Gatedleads page, with the opening paragraphs as the preview. How to gate a blog post after the first paragraphs covers that layout.

Create your gated page free, or see how Gatedleads works first.