How Do I Disable The Popup For Location Is Set For Another Country?

Topic summary

Users seek to disable or customize the geolocation/country recommendation popup that appears on Shopify stores, primarily affecting the Dawn theme but also Debut and others.

Primary Solution Offered:

  • Add CSS code to hide the popup by inserting .recommendation-modal__container { display: none !important; } at the end of the base.css file via Online store > Themes > Edit code
  • This targets the modal container class to prevent display

Key Challenges Reported:

  • The popup only appears for visitors outside the store’s set country (requires VPN testing)
  • One user reports conflicts when triggering custom modals alongside the geolocation popup, with page load delays causing both to appear simultaneously
  • The CSS solution may not work consistently across theme versions or older browsers/devices—the container gets hidden but the overlay wrapper (a div without a class) remains, blocking user interaction
  • Some users report the popup reappearing automatically in mobile view despite disabling it in theme header/footer settings

Current Status:
The discussion remains open with unresolved issues around cross-browser compatibility, timing conflicts with custom scripts, and complete removal across all theme sections. Users continue seeking more robust solutions or alternative approaches to either fully disable or customize the popup’s appearance and behavior.

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.

Hello! I just wanted to get rid of this popup that says what country the user is at. I use the Dawn theme.

My website is Mistmountainz.com/sale (/sale is the product page I direct people)
Also it is optimized for Mobile view and it only pops up when the visitor is outside the U.S (I used a VPN to Canada to show the popup)

Hi @HoodShine

To hide the location popup follow these steps:

  1. Open Edit code at Online store > Themes > Edit code:
![view - 2023-02-13T133310.215.png|1702x804](upload://uiZiU5MPd2yzeGctemKLqQQlvfr.png)
  1. Find the file “base.css” and paste the following code at the end of the file:
.recommendation-modal__container {
    display: none !important ;
}

I hope that it will work for your site.

2 Likes

Thanks!

1 Like

will this work for debut theme as well ?

Hi @Swaggerlikeme

We’re not sure it will work on the Debut theme because the class of the themes will be almost different. If you want to check if it works, please share your store link with us. Thanks

hi thanks for responding. So i have the following script to check if the recommendation-modal is open and not trigger unless its closed. Once the user interacts with the geolocation recommendation modal it reloads the page at which point it will check and confirm no modal then open.

It works well on chrome desktop and on my android phone using chrome i yet have to test it on iphone and other browsers. (most of the sites vistiors use mobile anyways) but the problem is the geolocation modal is for first time users from a foreign country. So i used my vpn and cleared browsing history and the page load speed is an issue because it takes longer then 10 seconds to load mainly waiting for the app to load. This maybe because its not my published theme and could be on a slower server. it ends up popping both modals at the same time because the delay runs out and will probably cause visitor to leave. is there a way to check if the geo location app is loaded then execute ? i know

window.addEventListener

and

window.onload

both wait for the images but im not sure if they wait for the app.

the current code is as follows:

// Get the modal
var slm_modal = document.getElementById("slm-myModal");

// Get the button that opens the modal
//var slm-btn = document.getElementById("slm-myBtn");

// Get the  element that closes the modal
var slm_span = document.getElementsByClassName("slm-close")[0];

var checks = 0;
var intervalID = setInterval(() => {
  if(!document.querySelector('.recommendation-modal__container') && ++checks > 10) {
    clearInterval(intervalID)
    setTimeout(() => {
      // trigger your own modal here
    //if (!sessionStorage.getItem('slm-shown-modal')){
    slm_modal.style.display = "block";
    //sessionStorage.setItem('slm-shown-modal', 'true');
  //}
    }, 1000)
    // 1000ms, (extra delay before your modal pops up)
  }
}, 1000)

// When the user clicks on  (x), close the modal
slm_span.onclick = function() {
  slm_modal.style.display = "none";
}

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
  if (event.target == slm_modal) {
    slm_modal.style.display = "none";
  }
}
// close the modal when button is clicked
function slm_close() {
  slm_modal.style.display = "none";
}

just need a way to ensure the app is loaded.

site url is: https://xotv47r6dfei2kub-52123107526.shopifypreview.com

thanks and sorry for the long message. I hope its not too unclear and my limited knowledge has not confused you. if I am going about this wrong any alternative suggestions would be greatly appreciated.

Thank you for your detailed information @Swaggerlikeme !

But your preview link has expired, can you kindly share a new link with us? We will check it for you.

Hi there,

Is there a way to change the colour of the button?

Hi @BSS-Commerce thanks for getting back here is a new link.

https://w06arrputv870kl3-52123107526.shopifypreview.com

thanks

RJ

Thank you so much, after a lot of hustle it finally solved the problem.

This is not a good solution. I used something similar:

And it works with new versions of browsers (Safari, Chrome…) and devices but problem is related to the older versions of browsers and devices. Thing here is that is not enogh to hide just .recommendation-modal__container, because that div is wrapped by div without class, and we need to hide that div too, if not then we have issue on older device. Container is hidden but overlay stays and customers are not able to interact with page.

Hi, I have this line keep showing on my page. Could you pls let me know how to delete it (as attached pictures). Many thanks> I use DAWN

.recommendation-modal__container { display: none !important ;

Hi,

The code didn’t work for me. My problem is that in the mobile version country and region pop up automatically while I disabled it from the theme both header and footer.

Thanks,