Google Confirms Robots.txt Can Block Googlebot From Rendering Popups
John Mueller confirmed robots.txt can stop Googlebot from rendering age-verification popups, laying out two blocking methods and one key condition: the page must still load.

- John Mueller confirmed on Reddit that robots.txt can block Googlebot from rendering an age-verification popup.
- Mueller detailed two methods: disallow the external popup domain's crawling, or block the specific JavaScript file loading the popup.
- Mueller cautioned against blocking a JS file that does multiple things beyond loading the popup.
- Pages must still load correctly when Googlebot cannot fetch the blocked resources.
- Google previously required unblocking all resources users see; some sites temporarily lost rankings during that transition.
Google Search Advocate John Mueller has confirmed that site owners can use robots.txt (the file that tells crawlers what they may fetch) to deliberately stop Googlebot from rendering an age-verification popup that human visitors are legally required to see — a notable exception to the long-standing expectation that publishers let Googlebot download everything users see.
Mueller's answer came in response to a question posted on Reddit. The SEO described a hypothetical site, websiteA.com, that loads an age-verification popup from a separate domain via an API and asked whether a disallow rule on verificationpopup.com's robots.txt would prevent Google from rendering the popup.
"Say I have a website websiteA.com – for legal reasons it has an age verification pop up that sits on a separate domain and is inserted on the page via an API," the Redditor wrote. "Lets say I wanted to block Google from seeing this – if I added a disallow on verificationpopup.com/robots.txt would that prevent Google from rendering the pop up?"
What did Mueller say?
Mueller confirmed the approach works and suggested an alternative. "That would generally work. If you're using a specific JS script file to do this, you could also disallow that specific javascript file via robots.txt. (If you only have one JS file that does a bunch of things, I wouldn't do that." His caveat matters: blocking a JavaScript file is only safe when that file does one thing — load the popup — and nothing else on the page depends on it.
Hours later, Mueller returned to the thread and spelled out two distinct methods in detail.
What are the two blocking methods?
According to Mueller's follow-up, the options depend on where the popup resource lives and what the site owner controls:
- Block the embedded site's content at its source. If a site embeds content from verificationpopup.com — via iframe or a script call — and that domain disallows all crawling in its robots.txt, Googlebot will not fetch the content and cannot use it in rendering. Mueller noted this is exactly how many ad services operate: Googlebot wouldn't crawl those URLs as separate pages, but it would attempt to fetch them during rendering, and a robots.txt block stops the fetch.
- Block the JavaScript file on your own site. If the popup loads through a dedicated file such as load-verification-popup.js, the site owner can disallow that file in their own robots.txt, and the script won't load during rendering. Mueller called this approach "less common" in his experience, but said it's necessary when you can't influence the external domain's robots.txt.
Does the page still have to work without the popup?
Yes. Mueller was explicit that pages must still load properly when Googlebot cannot fetch the blocked resources. For something like an age-verification popup, he said, that's usually not a problem — the underlying page content renders fine without it.
Why this matters for SEO
The context here is a decade-old policy shift. In the early days of SEO, practitioners routinely blocked Google from downloading JavaScript and CSS to conserve crawl budget. Then Google began rendering web pages and required site owners to unblock all resources users could see — and some sites that kept blocking critical resources temporarily lost rankings as a result.
That history is what made the Reddit question reasonable, and it's what makes Mueller's answer notable. Google's guidance has always been framed as "let us see what users see." Here, Mueller confirmed the inverse is acceptable in specific cases: site owners can exercise control over which resources Googlebot uses during rendering, including resources that are part of the experience presented to visitors.
The signal is that Google's tolerance for selectively blocked resources — ad scripts, age gates — is looser than the blanket "unblock everything" guidance implied, provided the page still renders completely without them.
Site owners running legally mandated age gates or similar interstitials now have a documented, Google-endorsed playbook. The thing to monitor next is whether Mueller or Google's documentation formalizes this tolerance for selectively blocked JavaScript beyond popups and ads into broader official guidance.
via reddit.com (Original)
More from James Calloway
Show full bio
Market editor covering money, funding and market shifts around Search rankings and algorithm updates, generative engine optimization at SERP Journal.
202 articles