Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Popup cannot be closed: how to find and fix it

PRF-227High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A popup (also called a modal or overlay) is a box that appears on top of your page. It becomes a problem when the visitor has no way to dismiss it. Common versions: the close button is missing, too small, off-screen on mobile, hidden behind another element, or present but does nothing because a script failed.

Usually the popup also sits on a dark layer (the overlay) that blocks every click on the page underneath. So the visitor is stuck until they leave or reload.

Why it costs you leads or sales

Everything behind the popup is unreachable: the lead form, the add-to-cart button, the chat button, the phone link. A visitor who wants to buy but cannot dismiss the box has no choice but to leave. Ad spend that brought them there is wasted.

It often goes unnoticed because the popup may only break on certain phones, screen sizes, languages or after a theme or plugin update. You test on your laptop and it looks fine.

Where the visitor gets stuck
  1. Ad clickVisitor lands on the page
  2. Popup opensOverlay covers the page
  3. Close attemptButton missing, tiny or dead
  4. Form or checkoutCannot be reached
  5. Lead or saleNever happens

The popup opens, the close control fails, and every later step is lost.

Visitors who reach the formExample numbers
Visitors who reach the form (example)Popup closes: 60 %; Popup cannot be closed: 5 %02346605Popup closesPopup cannot be closed%

Example: illustrative numbers for 100 visitors who see the popup, not measured data.

How to check if your site has it

Test the popup the way a visitor meets it, on more than one device.

Manual popup test
  • Open the page in a private window so the popup shows again.
  • Look for a close button (X) that is visible without scrolling inside the popup.
  • Click the X, click outside the popup, and press Esc. At least the X must work.
  • Repeat on a real phone, in portrait and landscape.
  • Try a small screen (about 360 px wide) using your browser's device mode.
  • Zoom the browser to 200% and check the X is still reachable.
  • Tab through the popup with the keyboard and confirm focus reaches the close button.
  • Check the browser console for red JavaScript errors when the popup opens.

How to fix it

Fix a popup that will not close
  1. Add a clear close button

    Use a visible X in the top corner, at least 44 by 44 px as a tap area, with good contrast against the popup background. Add an accessible label such as aria-label="Close".

  2. Let the overlay and Esc close it

    Clicking the dark area outside the popup and pressing Esc should both dismiss it, unless it is a legal notice that needs a choice.

  3. Keep the popup inside the screen

    Set a maximum height (for example 90vh) and let the content scroll inside, so the close button never ends up below the visible area on small phones.

  4. Check stacking order

    If another element (a sticky header, chat widget or second popup) sits on top of the X, lower its z-index or raise the popup's.

  5. Remove conflicting scripts

    If the console shows errors when the popup opens, disable recently added plugins or scripts one at a time until the close button works again.

  6. Test on real devices

    Confirm the fix on a phone and a desktop before publishing.

Where to change it on your platform
  1. Open your popup plugin

    In the plugin's popup editor (Elementor Popups, Popup Maker and similar), find the Close Button or Close settings and turn the button on.

  2. Enable overlay and Esc closing

    Look for options such as Click Overlay to Close and Press ESC to Close and switch them on.

  3. Rule out conflicts

    Deactivate other plugins one by one and recheck. Also test with a default theme if the X still fails.

Minimal closable popuphtml
<div id="popup" class="overlay" role="dialog" aria-modal="true" aria-label="Offer">
  <div class="popup-box">
    <button type="button" class="popup-close" aria-label="Close">&times;</button>
    <p>Popup content</p>
  </div>
</div>
<style>
  .overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
  .popup-box { position: relative; background: #fff; max-height: 90vh; overflow: auto; padding: 24px; max-width: 90vw; }
  .popup-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; font-size: 28px; background: none; border: 0; cursor: pointer; }
</style>
<script>
  var popup = document.getElementById('popup');
  function closePopup() { popup.style.display = 'none'; }
  popup.querySelector('.popup-close').addEventListener('click', closePopup);
  popup.addEventListener('click', function (e) { if (e.target === popup) closePopup(); });
  document.addEventListener('keydown', function (e) { if (e.key === 'Escape') closePopup(); });
</script>
The popup covers the button

The overlay sits on top of the page and the visitor cannot reach the button underneath.

How to confirm it's fixed

Fix confirmed when
  • The X is visible and works on desktop and on a real phone.
  • Clicking outside the popup and pressing Esc also close it.
  • After closing, the page underneath scrolls and the main button can be clicked.
  • The popup stays closed when the visitor moves to another page, if your tool is set to do so.
  • No red errors appear in the browser console when the popup opens or closes.

How to prevent it happening again

Popup habits

Before

  • Popup tested only on a laptop
  • No close button on small screens
  • Plugin and theme updates not rechecked

After

  • Popup tested on phone and desktop
  • Close button, overlay click and Esc all work
  • Popups rechecked after every update and design change

Add popup checks to your release routine: after any theme, plugin or popup tool update, open the key landing pages in a private window on a phone and close the popup. Keep only one popup active per page, so two overlays cannot trap each other.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. Its robot visitor runs your real journeys on a schedule and runs a check called cta_not_covered. That check fails when something, such as a popup or overlay, sits on top of the button the journey needs to click. So if a stuck popup blocks your form button, add-to-cart or booking button, FunnelGuard flags it, re-checks from a second region, and sends one alert with a screenshot and a likely cause.

What it does not check: whether every popup on every page has a close button, how popups look on each phone model, popups on pages outside your set-up journeys, or popups that only appear for certain triggers such as exit intent. A popup that covers nothing the journey clicks will not fail the check.

Questions people ask

Why can't I close the popup on my website?

The usual causes are a missing or tiny close button, a button pushed off-screen on mobile, another element sitting on top of it, or a JavaScript error that stops the close action. Open the browser console to look for errors, then test with plugins disabled to find the conflict.

How do I add a close button to a popup?

Turn on the close button in your popup tool's settings, or add a button with a click handler that hides the popup. Make the tap area at least 44 by 44 px and give it aria-label="Close" so screen readers announce it.

Why does my popup close button work on desktop but not on mobile?

On small screens the popup is often taller than the viewport, which pushes the X out of sight, or a sticky bar covers it. Set a max-height such as 90vh with scrolling inside the popup, and test on a real phone.

Should clicking outside a popup close it?

Yes, for most marketing popups. Closing on overlay click and on the Esc key gives visitors several ways out. Keep it required only for legal choices, and even then give clear options.

Can a popup that won't close hurt my conversions?

Yes. It covers your form, cart or call button, so visitors cannot act and usually leave. It can also frustrate paid traffic, which wastes ad spend.

Can FunnelGuard detect a popup that cannot be closed?

Partly. Its cta_not_covered check fails when something covers the button a journey needs to click, so a popup blocking your form or checkout button is flagged. It does not audit every popup or close button on your site, so test those by hand.

How do I test a popup that only shows once?

Use a private window or clear the site's cookies and local storage, because many tools remember that a visitor has seen the popup. Then trigger it again by waiting, scrolling or moving to leave the page.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: cta_not_covered fails.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.