Google On How To Block Popups Using Robot.txt In Search

Search Engine Roundtable by 3 min read 505x views
Google On How To Block Popups Using Robot.txt In Search

Share Post

Google Popup

Google's John Mueller explained how to forestall pop-up dialogs on your website from appearing in Google Search using the robots.txt file. He mentioned how to do this if you are using JavaScript for the pop-up.

The inquiry was posted on Reddit asking how to obstacle these lawful pop ups from showing up in Google Search and being indexed by Google. The inquiry was:

Say I have a website websiteA.com - for lawful reasons it has an age verification pop up that sits on a distinct domain and is inserted on the leaf via an API. Lets call it verificationpopup.com

Lets say I wanted to obstacle Google from seeing this - if I added a disallow on verificationpopup.com/robots.txt would that forestall Google from rendering the pop up?

John Mueller replied saying, "That would mostly work." "If you're using a particular JS manuscript document to do this, you could additionally disallow that particular javascript document via robots.txt," he added. He additionally stated that "if you lone have one JS document that does a bunch of things, I wouldn't do that."

Here is his additional detailed reply alongside these two options:

  • The embedded site's satisfied is blocked by robots.txt. If you embed satisfied from verificationpopup-com on your location (say via iframe or by calling a manuscript on verificationpopup-com, etc), and verificationpopup-com disallows all crawling, afterward crawlers that prosecute robots.txt (like Googlebot) would not fetch that content, and would not use it in rendering. This is how many ads services work. Googlebot wouldn't crawl these URLs akin a distinct page, but it would try to fetch them during the way of rendering, and if robots.txt blocks it, afterward it doesn't fetch the content, and can't use it. You need to create certain that your pages motionless burden whenever those URLs are not fetched, but for item akin this, that's normally not a problem.
  • Your location uses a particular JS document to burden this, and you obstacle that yourself. For example, perchance you use a "load-verification-popup.js" document to do this. If you obstacle that leaf alongside robots.txt on your site, afterward the manuscript won't be loaded during rendering (blocked by robots.txt). In my experience, this is small common, but it's an option. If the robots.txt on verificationpopup-com is not item you can influence, you'd need to do this if you wanted to forestall it from being visible/used during rendering.

There are likely another ways to do this but current is the recommended method from a Google Search representative.

Forum conversation at Reddit.

Other Article Search Engine Roundtable
↑
Close Right Ads
Close Left Ads