How to add a waitlist form to WordPress
The block editor's Custom HTML block accepts a script tag, so you can add an EarlyTrap form to any page or post without installing a plugin.
Step 1: Get your embed code
- Sign in to EarlyTrap and click Create Project. Enter a name and your site's address in the Website URL (Origin) field: the domain only, with no page path, starting with
https://www.(for examplehttps://www.yoursite.com). The form only saves emails when the page that shows it is served from that address. - Open the project, choose Widget in the sidebar and click Add New Form.
- Click Config on the new form. Change the placeholder, button text or colors if you like.
- Click the copy button next to Copy script to embed.
You get a snippet like this. The three IDs are unique to your form; the ones below are placeholders.
<div id="next-subscribe-form-normal"></div>
<script
src="https://www.earlytrap.com/widget.js"
data-project-id="YOUR_PROJECT_ID"
data-widget-id="YOUR_WIDGET_ID"
data-uid="YOUR_UID"
async
></script>Step 2: Add it to WordPress
- Open the page or post in the block editor.
- Click the Block Inserter icon and add a Custom HTML block. You can also type
/htmlin a new paragraph and press Enter. - Click Edit HTML, paste your whole EarlyTrap snippet and press Update.
- Update or publish the page, then open it as a visitor to check the form.
Saving a <script> needs the unfiltered_html capability. For users without it, such as Contributors, WordPress strips tags like <script> and <iframe> when the post is saved.
Official docs: WordPress documentation: Custom HTML block.
If the form does not appear
- Paste both parts of the snippet: the
<div>is where the form appears and the<script>loads it. - Replace the placeholders with the real IDs from Config. If one is missing, the browser console shows "EarlyTrap: missing required data attributes".
- Keep to one EarlyTrap form per page.
If the form appears but signups are not saved
The form shows on any site, but it only saves emails when the page is served from the Website URL (Origin) of your project: same protocol and same domain, including the www. prefix. Check that the project's URL is your site's address without a page path. To confirm that signups are saved, submit a test email and look for it under Emails & Broadcasts in your project.
After you publish
Every signup appears under Emails & Broadcasts in your EarlyTrap project, where you can also send a broadcast to your list. Changes you make in Config apply to a form that is already embedded, so you do not need to paste the snippet again.
FAQ
Why does my snippet disappear after I save?
Your role probably lacks the unfiltered_html capability, so WordPress removes the script when saving. Ask a site administrator to add the block or to change your role.
Can I add it to a post instead of a page?
Yes. The Custom HTML block is available anywhere you use the block editor, posts included. Keep to one EarlyTrap form per page or post.