Checked against the official WordPress Custom HTML block documentation on 12 November 2026. This guide was not tested on a live WordPress install; themes, roles, hosts and caching layers vary, so verify on staging first.
A popup in WordPress does not require a popup plugin. You can build the popup once in PopupLoom, paste two lines into your theme footer or a single Custom HTML block, and keep the design editable from the hosted studio. This page covers the three practical ways to do it, what breaks most often, and when a plugin is genuinely the better choice.
Popup in WordPress: the short version
- Create and save the popup in the PopupLoom studio.
- Copy the two-line install code from Publish.
- Paste it before
</body>in a child theme, in a code-snippet plugin, or in a Custom HTML block on one page. - Purge every cache layer and test the published URL in a private window.
That is the whole integration. You do not need a plugin, there is no database table to create, and there is no per-pageview fee. If you would rather have a settings screen, the free PopupLoom Popup Builder Embeds plugin takes the same widget ID. The popup configuration stays on PopupLoom's side, so you can change the offer or design later without editing the WordPress site again.
Why not just install a popup plugin?
A dedicated popup plugin can be the right answer in some cases, but it is not the default. The trade-offs are real:
- Weight. A plugin loads PHP, admin assets and often a front-end builder on every request. A hosted snippet is two small elements and one script.
- Lock-in. Designs stored inside a plugin are harder to move. A hosted configuration is independent of the WordPress theme.
- Maintenance. Every plugin adds update, compatibility and security surface. Fewer plugins is usually better for a site you do not actively maintain.
- Cost. Many popup plugins gate exit intent, targeting or view volume behind a paid tier. PopupLoom has no pageview cap and no paid upgrade inside the product.
A plugin may still be better if you cannot edit theme code, your host blocks scripts, or a client needs every change made from the WordPress admin. In those cases, use a plugin — just choose it deliberately rather than by default.
A popup builder for WordPress, with or without a plugin
If you searched for a WordPress popup builder, this is how PopupLoom fits. The builder is a hosted visual studio: you pick a template, change the words, colours and trigger, set which pages it appears on, and save it. WordPress only needs the two-line install code, so the design can change later without touching the site again.
Popup types that work well on a WordPress site, each with its own template page:
- Email signup for a newsletter, a checklist or a waitlist.
- Exit intent for a last offer. It is desktop only, so pair it with a delay or scroll trigger for phones.
- Announcement bar for a short notice such as a delivery cut-off or a sale end date.
If you want the technical detail on wp_footer, caching layers, Content Security Policy and multisite, read how to add a popup to WordPress without a plugin. If you would rather write a simple popup by hand, the popup HTML generator produces the code for you.
Before you start
- You need permission to add custom HTML or edit theme code. On a client site, confirm that before touching anything.
- Your WordPress role needs the
unfiltered_htmlcapability for script tags. The official block documentation says users without it have their block content sanitized bywp_kses(), which strips disallowed tags such as<script>and<iframe>. - Some managed WordPress hosts, security plugins and caching layers also remove or delay scripts. Confirm on staging before promising a client that the popup will run.
- Back up the site, or work on a staging copy. Do not paste code into a live theme you cannot restore.
Step 1: Save the popup and copy its code
Create the design in the PopupLoom studio. Sign in, save the widget, and open Publish. Copy the two lines that contain the saved widget id and popuploom.js. The full model is in the installation guide. Guest previews do not issue hosted code.
Step 2: Add it with a Custom HTML block
Use this for a single page, post or landing page.
- Open the page or post in the WordPress block editor.
- Add a Custom HTML block. The official documentation describes searching for “Custom HTML” in the block inserter.
- Paste the two PopupLoom lines into the HTML field.
- Use the block preview to check that the markup is present. Do not type the angle brackets as visible text in a Paragraph block.
- Update or publish the page, then open the published URL in a private window.
If the script disappears after saving, your role probably lacks unfiltered_html, or a security plugin filtered it. Move to a footer-code method instead of fighting the sanitizer.
Step 3: Or add it once in footer code
Use this when the popup should appear across the site. Add the two lines before the closing </body> tag in a child theme's footer template, or through a code-snippet plugin that explicitly allows JavaScript. Do not edit the parent theme directly; a theme update can remove the change.
If your theme does not have a footer.php, or you use a block theme, add the snippet through a code-snippet plugin that injects before the closing body tag. That is still not a popup plugin: it is a paste box for the same two lines.
Keep the widget div and script together. If you paste only the script, no popup is mounted. If you paste only the div, nothing loads the runtime.
Step 4: Clear caches and test
- Purge the page cache, object cache, CDN cache and any optimization-plugin cache.
- Open a private window and a logged-out session. Do not test while signed in as an administrator if your caching or script rules differ for administrators.
- Perform the actual trigger: load, delay, scroll depth, click, scroll-to element or desktop exit intent.
- Check the browser console for blocked requests or CSP errors.
- Submit one test form response and confirm it appears in the PopupLoom lead inbox. Use fake data.
Common WordPress problems
- The block shows the words “Custom HTML” or the code as text. The editor may have escaped the markup. Use the HTML view of the block, not a paragraph.
- The script is missing from the published page. Check
unfiltered_html, security plugins, and host-level script filtering. - The popup appears once and never again. Check the frequency setting and whether a page cache is serving an old configuration. Frequency is stored in the visitor's browser.
- Desktop exit intent does not fire on mobile. Exit intent is desktop only by design. Use a delay, scroll or click trigger for mobile.
- Nothing renders inside the editor preview. The block preview is not the published site. Test the published URL.
- A plugin update breaks it. Security and optimization plugins change how scripts are combined or deferred. Re-check the published source after major plugin updates.
Removing the popup
Delete the Custom HTML block from the page, or remove the two lines from the footer code, then purge caches. Deleting the hosted widget in My popups disables the configuration; removing only the snippet removes it from that WordPress site.
WordPress popup FAQ
How do I add a popup in WordPress for free?
Build it in PopupLoom, save it, copy the two-line install code, and paste it into a Custom HTML block or your theme footer. There is no per-view charge. You still need permission to add custom HTML or edit theme code.
Do I need a popup plugin?
No. A plugin is optional. A footer snippet or one Custom HTML block is enough. A code-snippet plugin is only a paste box for the same two lines; it is not required if you can edit a child theme.
Why is my WordPress popup not showing?
Check the published page source first. If the script is missing, the cause is usually unfiltered_html, a security plugin or a host filter. If the script is present, check caching, the frequency rule, the trigger type and the browser console.
Will this work with a block theme?
Yes, if you can inject the snippet before the closing body tag. Block themes use the Site Editor, so a code-snippet plugin or a child theme is usually simpler than editing a block template directly.
Can I use PopupLoom as a WordPress popup builder?
Yes. You design the popup in PopupLoom's visual studio, with templates, triggers, page rules and a lead inbox, then add two lines of code to WordPress. The builder lives on PopupLoom, not inside the WordPress admin.
Is there a PopupLoom WordPress plugin?
Yes. PopupLoom Popup Builder Embeds is in the WordPress.org plugin directory. Install it, open Settings > PopupLoom and paste your widget ID. It only loads the hosted PopupLoom runtime; you still design the popup in the PopupLoom studio. A plugin is optional, because pasting the two-line install code into a Custom HTML block or a child theme works too.
Does it work in the editor preview?
Usually not. Scripts are often stripped in the editor and block preview. Test the published URL in a private window.
Can I show it on only one page?
Yes. Use a Custom HTML block on that page instead of site-wide footer code. Keep the div and script together.
Official references
- WordPress.org: Custom HTML block documentation
- WordPress.org: Block editor documentation
- WordPress Developer Handbook: Escaping and sanitization
The PopupLoom product screenshots and install steps were checked on the local build. WordPress plan details and plugin behavior must be verified on your own site. See the About, privacy, terms or contact pages. Next: popup not showing, exit-intent popups, or email signup popups.