Written for self-hosted WordPress. Theme code can break a site; back up first and use a child theme. Behavior checked on the local PopupLoom build on 14 November 2026.
You can add a PopupLoom popup to WordPress without installing a popup plugin. Build and save the popup in the PopupLoom studio, copy the two-line install code, and print it from your child theme’s functions.php on the wp_footer hook. The popup then loads on the public site while the configuration stays in your PopupLoom account.
This method is for people who are comfortable editing theme code or using a code-snippet tool. If you want popups managed inside the WordPress admin, a native popup plugin is a better fit. If you want the plugin path, read the WordPress popup guide instead. A plugin also exists: PopupLoom Popup Builder Embeds on WordPress.org adds a Settings > PopupLoom screen for a widget ID and loads the runtime in the site footer, and the no-plugin method on this page still works.
What you need
- A self-hosted WordPress site where you can edit theme files or add a code snippet.
- A saved PopupLoom widget and its install code. A guest draft has no install code.
- A child theme, or a code-snippet plugin you already trust. Never edit the parent theme directly.
- A way to clear the page cache and CDN cache after the change.
Step 1: build and save the popup
- Open the PopupLoom studio and choose a template or start blank.
- Set the content, trigger, page targeting, devices and frequency.
- Save the popup, open Publish, and copy the install code. It looks like this:
<div data-popuploom="wan_your_widget_id"></div>
<script src="https://popuploom.com/embed/1.2.0/popuploom.js"></script>
Keep the widget id exact. The script loads the saved configuration for that id; the config changes in the studio do not require a new snippet.
Step 2: print the snippet in a child theme
Add this to the child theme’s functions.php. Replace the example id with your real widget id.
add_action( 'wp_footer', function () {
?>
<div data-popuploom="wan_your_widget_id"></div>
<script src="https://popuploom.com/embed/1.2.0/popuploom.js"></script>
<?php
} );
wp_footer runs before the closing body tag on the public site. It does not run in the WordPress admin, which is what you want. If your theme does not call wp_footer(), the hook will not run; add the snippet to the child theme’s footer.php before </body> instead.
Alternative: child theme footer file
- Create or open the child theme’s
footer.php. - Paste the two-line snippet immediately before
</body>. - Save, clear the cache, and load a public page in a private window.
Do not paste the snippet into the block editor’s Custom HTML block unless you know the site allows <script> for your user. WordPress can strip script tags for non-administrators, on multisite, or on restricted WordPress.com plans.
Alternative: a code-snippet tool
If you do not want to edit theme files, a code-snippet plugin can add the same code to the footer. That is still a plugin, but it is not a popup plugin. Use one you already trust, restrict it to administrators, and keep it updated. The placement rules are the same: public footer, real widget id, after the page is cached.
WordPress.com and multisite limits
- WordPress.com: custom JavaScript requires a plan that allows it. Lower plans may strip the script; check your plan before buying.
- Multisite: only a super administrator may have
unfiltered_html. A site administrator may be unable to save a script tag in the editor. - Managed hosts: some disable theme editing or enforce a Content Security Policy. Use a staging site and check with the host.
Caching, optimization and CSP
- Clear the page cache and CDN cache. A cached page can keep serving the old footer after the code is added.
- Exclude the script from combine/defer. If a performance plugin combines or delays scripts, the popup may load late or not at all. Exclude
popuploom.com/embed/1.2.0/popuploom.js. - Allow the script in your CSP. If the site sends a Content Security Policy, allow
https://popuploom.cominscript-src. Do not add a hash; the file is updated independently of your HTML. - Do not add SRI unless you pin the version. The immutable
/embed/1.2.0/path is stable, but the configuration is fetched separately. If you add an integrity attribute, you own the update process. - Check the console. A blocked script, a CSP violation or a 404 on the widget config is visible there.
Test it properly
- Open a public page in a private window, not the logged-in admin preview.
- Trigger the popup with the rule you configured: load, delay, scroll, click or desktop exit intent.
- Submit one fake response and confirm it appears in the PopupLoom lead inbox.
- Test on a phone. Exit intent is desktop-only by design.
- Clear the cache again and repeat on the live URL.
If nothing shows, use the popup troubleshooting guide. It covers the snippet, saved id, trigger, page/device rules, frequency, selectors, CSP, cache and iframe limits.
Without a plugin vs a popup plugin
- Choose the theme-code method if you want fewer plugins, a hosted configuration, the same popup on other platforms, and you are comfortable with child themes.
- Choose a popup plugin if you want popups managed inside WordPress, WordPress-specific conditions, WooCommerce cart data or a support contract.
- Do not run both on the same page during a migration. Pause one before enabling the other.
Common questions
Can I add a popup to WordPress without any plugin?
Yes, on a self-hosted WordPress site that allows theme code. Build the popup in PopupLoom, copy the two-line install code, and print it from a child theme’s functions.php on the wp_footer hook, or paste it into the child theme footer before the closing body tag.
Will a theme update remove the popup code?
A parent theme update overwrites direct edits. Use a child theme, or a code-snippet plugin, and keep a backup. The PopupLoom configuration lives in your account, so the snippet itself rarely changes.
Does this work on WordPress.com?
Only on a WordPress.com plan that allows custom JavaScript. Lower plans and some multisite setups strip script tags. On a self-hosted WordPress site you control the theme and can add the snippet.
Why is my WordPress popup not showing?
Check the widget id, page caching and CDN cache, script optimization or defer settings, the site’s Content Security Policy, the trigger and frequency rule, and the browser console. The troubleshooting guide has a step-by-step diagnosis.
Should I use a popup plugin instead?
Use a popup plugin if you want popups managed inside WordPress, WordPress-specific conditions or a WooCommerce integration. Use the theme-code method if you want fewer plugins, a hosted configuration and the same popup on other platforms.
Build a popup Read the WordPress plugin guide