WordPress site has stuck modal popup that won't dismiss with close button

My WordPress homepage has a persistent modal issue that started after hosting problems

After my web host fixed some server issues, my WordPress site now shows a semi-transparent modal dialog that appears whenever someone clicks on the homepage. The modal seems to be stuck and won’t go away when users click the close button.

Here’s what I’ve noticed:

  • The modal only disappears when pressing the ESC key
  • Clicking the X button does nothing
  • The overlay stays even if the page sits idle
  • I can still navigate to other pages by right-clicking and opening links in new tabs
  • This problem only happens on the main homepage

I’m not sure what caused this modal to get stuck or why the close functionality stopped working. Has anyone experienced something similar after hosting issues? What steps should I take to troubleshoot this modal problem?

Check your theme’s functions.php file or any custom code that might’ve been changed during the server maintenance. Hosting providers sometimes overwrite customizations or revert files to older versions when they restore backups or fix server issues. The close button issue sounds like a missing JavaScript function or corrupted event binding. I’d also check the modal’s HTML in your browser’s dev tools - see if the close button still has its onclick attributes or data attributes. These often get stripped out when files aren’t restored properly.

I encountered a similar issue with a modal popup after a recent migration with my hosting provider. It’s likely that files or the database were restored from a previous backup, which might have caused conflicts with your current setup. I recommend checking if any plugins, particularly the one controlling the modal, reverted to older versions—this could introduce bugs. Additionally, clearing your site cache completely is crucial since old cache files can create persistent issues. The fact that the ESC key works and the close button doesn’t points towards a JavaScript conflict rather than a styling issue.

sounds like the server fix broke a js event listener. try deactivating all your plugins temporarily - if the modal goes away, turn them back on one by one to find out which one’s causing it. also, check your browser console for js errors when clicking the close button.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.