# WordPress Popup Without a Plugin: 3 Places to Add It

> Add a popup to WordPress without another plugin: paste one script tag in your theme's footer, a child theme or a Custom HTML block, then check it loads.

By Aleksan Aharonyan, November 17, 2026. Original: https://popupgenius.app/blog/wordpress-popup-without-plugin/

You can add a popup to WordPress without installing a popup plugin in two ways: write the popup yourself in HTML, CSS and JavaScript, or paste one script tag from a hosted popup tool just before the closing body tag of your theme. The script tag is the practical route for most sites, because the popup's design, triggers and signups live outside WordPress while the site only loads a small file. Where you paste that tag depends on your theme, and getting that part right is most of the job.

## Key takeaways

- Put the script tag in a place that survives theme updates: a theme setting for footer scripts, a Custom HTML block in the footer template part, or a child theme, never the parent theme's own files.
- On a block theme, the Site Editor's footer is the simplest home for the tag; on a classic theme, a child theme that hooks into the footer is the cleanest.
- After pasting, clear any page cache, open the site in a private window and confirm the tag is in the page source before you blame the popup.
- Decide the trigger, the pages and the frequency before you publish, so the popup appears where it helps and stays away from everywhere else.

## Why skip the plugin, and what you give up

Skipping a popup plugin keeps WordPress lighter: no extra settings screens, no plugin updates to track, and no plugin code running on every admin page load. A popup added with a script tag runs only in the visitor's browser, so your database and admin stay as they were.

There are two ways to do it, and they cost different things.

**Hand-coding the popup.** You write a dialog in HTML, style it, and add JavaScript that opens it, closes it, remembers that a visitor closed it, and sends the form somewhere. It costs nothing but time, and you control every line. The catch is everything around the box: keyboard focus, the Escape key, a frequency cookie, mobile sizing, spam protection on the form, and a place to store emails. Each of those is small, and together they are a project.

**A hosted popup tool loaded by a script tag.** You design the popup in the tool, and one line in WordPress loads it. Triggers, frequency, page targeting and the email list are handled by the tool. You give up some control over the code and you depend on a third party, so pick one that loads its script without blocking the page.

For a single announcement on one page, hand-coding is reasonable. For an email signup you plan to run and adjust for months, a hosted tool saves the maintenance.

## Step 1: get the script tag

A hosted popup tool gives you one script tag tied to your site's address. In [PopupGenius](https://app.popupgenius.app/account/signup), for on-brand upsell and email popups on your website, you register your site's address on the Site page and copy the tag from there. It is added with one script tag before the closing body tag, and the free plan needs no card. It looks like this, with your own site key:

```html
<script async src="https://cdn.popupgenius.app/p/YOUR-SITE-KEY.js"></script>
```

Register the address visitors actually use. The www and non-www versions of a domain count as the same site, but a staging subdomain or a different subdomain does not, so a tag tested on a staging copy will not show popups until that address is the registered one.

## Step 2: paste the tag before the closing body tag

WordPress gives you three places to put a script without a plugin. Use the first one your theme offers.

### Option A: your theme's own footer scripts setting

Many themes include a field for custom header and footer code in their theme options or in the Customizer. If yours has a footer field, paste the tag there and save. This is the quickest route, and the code survives theme updates because it is stored as a setting rather than in a file. Check after switching themes, though: the setting belongs to the theme and does not carry over.

### Option B: a Custom HTML block in a block theme's footer

On a block theme you edit the site's templates in the Site Editor. Open the footer template part, add a Custom HTML block at the end, paste the tag, and save. Because the footer part is shared by every template that uses it, the tag loads on every page that shows that footer. Two things to check: some templates, such as a blank landing page template, have no footer part, and adding raw script in a block needs an administrator account on a self-hosted site. On hosted WordPress.com, custom code may depend on your plan, so check what yours allows before you plan around it.

### Option C: a child theme that enqueues the script

On a classic theme, or when you want the tag in code under version control, use a [child theme](https://developer.wordpress.org/themes/advanced-topics/child-themes/) so a parent theme update cannot overwrite your change. In the child theme's functions.php, load the script with [wp_enqueue_script](https://developer.wordpress.org/reference/functions/wp_enqueue_script/), which prints it in the footer and adds the async attribute for you:

```php
add_action( 'wp_enqueue_scripts', function () {
	wp_enqueue_script(
		'popupgenius',
		'https://cdn.popupgenius.app/p/YOUR-SITE-KEY.js',
		array(),
		null,
		array( 'in_footer' => true, 'strategy' => 'async' )
	);
} );
```

Passing null as the version keeps WordPress from adding its own version number to the address. The loading strategy argument needs a recent WordPress version; on an older install, keep in_footer set to true and drop the strategy part.

Avoid editing the parent theme's footer.php directly. It works until the next theme update, and then the popup disappears without any error to tell you why.

## Step 3: check that the tag actually loads

A popup that does not appear is usually a tag that is not on the page. Check it in this order.

1. **Clear your caches.** A page cache, a host's built-in cache or a CDN can keep serving the old page for hours. Purge them after pasting.
2. **Open a private window.** Logged-in administrators sometimes see a different page than visitors, and a private window also has no frequency memory from your earlier tests.
3. **View the page source.** Search for the tag near the bottom of the page. If it is missing, the template you are looking at does not use the footer you edited.
4. **Check the tool's status.** In PopupGenius the Site page switches to "Installed" once a browser on your site has loaded the script, so you know the tag is right before you look at any popup setting.

If the tag is present and the popup still does not open, the problem is the popup's own settings: it is not switched on, its trigger has not fired yet, or its page rules exclude the page you are on.

## Step 4: decide where and when the popup appears

The tag loads on every page, so the popup's settings decide where it shows. Set three things before you publish.

**Pages.** Without a plugin you have no WordPress-side rules, so do the targeting in the popup tool with URL rules. A newsletter signup might start only on posts, which on many sites share a path like /blog/, while a contact or checkout page is better left out. In PopupGenius a rule can match a path exactly, by its start, or by text it contains, and you can also show a popup everywhere except the pages that match.

**Trigger.** Showing a popup the moment a page opens interrupts people before they know what the site is. A short timer, a scroll depth on long posts, or exit intent on desktop all wait for a sign of interest. The [email popup timing guide](/blog/shopify-email-popup-timing/) goes through how long to wait and why, and the reasoning holds on any platform. Exit intent depends on a mouse leaving the window, so pair it with a timer or scroll trigger for phones; the [exit-intent popup setup guide](/blog/shopify-exit-intent-popup/) explains what that signal can and cannot detect.

**Frequency.** Once per visit is a sensible starting point to test. A visitor who closed the popup has given you an answer, and seeing it again on the next page reads as a bug.

## If you decide to hand-code it after all

Some site owners want zero third-party code. If that is you, budget for these parts, because a popup without them annoys visitors or loses signups:

- **An accessible dialog.** The native HTML dialog element handles focus and the Escape key better than a styled div.
- **Frequency memory.** A cookie or local storage entry so a closed popup stays closed for the visit or for a set number of days.
- **A form endpoint.** Somewhere for the email to go: your mail tool's form address or your own handler, plus spam protection.
- **Mobile behavior.** A layout that fits a small screen and a close button big enough to tap.

Put the code in a child theme the same way as Option C, as your own script file. It is entirely doable; just compare the afternoon it takes with how often you expect to change the popup.

## FAQ

### Will a popup script slow down my WordPress site?

It depends on how the script loads. A tag with the async attribute does not block the page from rendering, and a script that waits until the page has loaded before doing its work keeps the popup out of the way of your content. Check your own pages with a speed test before and after adding it.

### Will a theme update remove the popup?

Not if the tag lives in a theme setting, in a block theme's footer template part, or in a child theme. It will if you pasted it into the parent theme's own files, because an update replaces those files. Switching to a different theme is another matter: move the tag to the new theme's footer.

### Can I show the popup only on some WordPress pages?

Yes, but without a plugin the rule lives in the popup tool rather than in WordPress. Use URL rules that match a path, such as every address starting with your blog's path, or show the popup everywhere except a list of pages. Remember that WordPress permalinks decide those paths, so check them before writing the rules.
