How to Remove Google Text Ads

It seems that almost every web page you view these days has Google AdSense texts ads spread across the top or down the side.

These ads have never bothered me. They are easy enough to ignore and besides, website owners are entitled to earn a living just like the rest of us.

However, lately some sites have started embedding the Google ads in the center of the page or worse still, right in the middle of a block of text. So I decided enough was enough and started looking for ways to block the ads.

It turns out that it's dead easy to stop them. In fact there are many ways you can do it. For example Firefox users can use the AdBlock or CustomizeGoogle extensions to kill the ads while Internet Explorer users can use one of the many ad-blocker add-ins such as AddSubtract, WebWasher or the excellent freeware program IE7Pro.

Perhaps the simplest and most universally applicable method is to use the Windows Hosts file to block the address of the Google ad-server.

There is another advantage in using this technique; it will help you develop an understanding of the Hosts file and its many uses.

The Windows Hosts file

This a file on your computer that can be used to locally translate the names of web sites into IPs. IPs are sets of four numbers separated by dots like 65.109.128.16. They are the real addresses of the internet not web site names (URLS). Names are only a convenience and have to be translated into IPs. For example, the name (URL) of my website is techsupportalert.com but its IP, its "real" address on the internet, is actually 72.52.134.218.

Normally this kind of translation takes place at your ISP. They have a special server dedicated to the task called a DNS server. Whenever you type a URL like www.techsupportalert.com into your browser address window, the DNS server translates the name into the corresponding IP 72.52.134.218. It's automatic and requires no involvement from you.

However, you can also do it locally on your own PC and that's where the Windows Hosts file comes into play.

The Hosts file is just a plain text file containing a simple list of web site names (URLs) and their corresponding IPs. Here's an example of what a Hosts file might look like:

216.109.118.69  www.yahoo.com
72.52.134.218    www.techsupportalert.com
216.239.115.141 www.cnet.com

You can think of this like an address book. In an address book you look up a name and find the address. With the Hosts file you look up a web site name (URL) and find the address (IP). In the example above, any reference to the name www.yahoo.com will directed to the address 216.109.118.69.

Now, the Hosts file on most computers has nothing in it. That's fine because the DNS translation is usually handled by your ISP.

If your Hosts file does have entries then these are used for the DNS translation for those sites instead of your ISPs DNS server. This is actually fractionally quicker as it saves a step. In fact. some web accelerators store thousands of popular sites in your Hosts file to take advantage of this slight increase in speed.

But there's another common usage for the Hosts file: to block addresses. This is done by using a dummy address, typically 127.0.0.1, that goes nowhere. For example, consider this entry:

127.0.0.1 wwww.yahoo.com

With this entry in the hosts file, any reference to www.yahoo.com will be redirected to the address 127.0.0.1. Now that address is not a valid web address for any real web site. In fact, by convention it refers to your own computer.

If you have this entry in your Hosts file and you type www.yahoo.com into your browser, you'll get an error message: "Host cannot be found."

This is the very technique that we can use to block Google text ads.

Stopping Google Ads with the Hosts File

All the Google text ads seem to come from the addresses pagead.googlesyndication.com or pagead2.googlesyndication.com. If we place these names in the Windows Hosts file and point them to a dummy address then the Google ads will not appear.

First though, we need to locate the hosts file. Here is the usual location for the major Windows versions:

Windows 9x, ME C:\WINDOWS
Windows NT (and some 2K) C:\WINNT\system32\drivers\etc
Windows 2K, XP, 2003, Vista C:\WINDOWS\system32\drivers\etc

The Hosts file is simply called "HOSTS" and has no file extension.

It's a simple text file and must only be changed with a plain text editor like Notepad and never a word processing program such as MS Word.

First, we need to open the Hosts file in Notepad. If you don't know how to do that then locate the Hosts file in Windows Explorer and right-click on it. Select "Open" and then check "Select the program from a list." You'll then be presented with list of programs; select Notepad. You should now see a simple text file.

Go to the first blank line at the bottom of the file and type in ( or copy and paste) these two lines:

127.0.0.1 pagead.googlesyndication.com
127.0.0.1 pagead2.googlesyndication.com

Make sure you leave no blank lines before this entry.

Just save the file and you are finished. Saving this change may spark an alert from your anti-spyware software but it's OK, just approve the change.

If you've followed the instructions carefully you should never see Google AdSense text ads again. If at a future stage you want to see the ads again, just use Notepad to delete the line you just added.

The same technique can be used to block other advertising servers, malicious spyware or sites containing inappropriate material. In fact a number of folks offer free downloads of Hosts files containing thousand of entries of such unwanted sites.

I'm not a great fan of using the Hosts file for such large scale blocking. To me it's too unselective - I prefer to know exactly what I am blocking and this is virtually impossible with a list containing thousands of sites. However if you want to play with this kind of application, here are some Host file download sites:

http://www.hosts-file.net/
http://www.mvps.org/winhelp2002/hosts.htm

Dedicated Host file enthusiasts may want to check out Hostess, a free Hosts file editor/manager you can get from here: http://www.raymarron.com/hostess/

Gizmo

 

Share this
4.125
Average: 4.1 (160 votes)
Your rating: None

Comments

by murch on 18. June 2014 - 15:46  (116824)

This is a great workaround. I just tried also adding a line for Google's new search homepage ad (d.startpagea.com). Now all I get is the "Unable to connect" message which is visibly obvious but after two or three views is not distracting.

Thanks.

by LaurelC on 9. May 2014 - 21:35  (116126)

I suddenly started having this issue in Internet Explorer... certain websites I tried to go to would not come up and it would state, "This page can't be displayed". I thought at first it was a virus. What showed in the URL was the following:

http://pagead2.googlesyndication.com

I knew I had the problem right after I had gone to Internet Options and Manage Add-ons and messed around in there, so I tried to retrace my steps and soon I had figured it out. This is what I did to correct the problem:

-------------

Go to Internet Options---->then to Manage Add Ons-----> then to Tracking Protection--------> Now highlight "Your Personalized List"-----> click the box below in right hand corner of page that should say, "Disable"--------> Now, click the box "Close".

-------------

This took care of the problem for me.

=============================================

Btw.. I am using Windows 8.1 and Internet Explorer 11.

by Juxxize on 7. December 2012 - 14:45  (103422)

You are right the ads never bothered me before but just lately they have been getting more and more and there is nothing more annoying than clicking on an ad instead of the link you meant to click on and being taken away to another page unable to use the 'page back' button to get back to reading what you was reading before you were taken on a magical mystery tour of a google ad sense ad ( and usually the magical mystery tour takes you to an ad that you have no interest in).
I think Google have shot themselves in the foot making there ads form being 'not annoying' to being 'annoying'

by mistwhisper (not verified) on 26. November 2012 - 10:46  (102926)

This works perfectly. Thank you so much for relieving me from the ads. It's exactly what I needed =D

by gerry-d (not verified) on 14. June 2012 - 5:11  (94824)

ATTENTION ALL, please:

I have added the two lines suggested

127.0.0.1 pagead.googlesyndication.com #google adds
127.0.0.1 pagead2.googlesyndication.com #google adds

but the google ads are not blocked. So the hosts file appears ineffective. The same problem is if I use IE. I have not tried other filters yet, I want to see what the problem with hosts file is, as it is no good to leave a bug(?) in the system.

BTW I am using Chrome browser and xp windows. The problem seems more ominous. Coincidently(?), the browser became in Greek throughout whilst the default language is English!!! and it is impossible to change it back to English. I never did any change by myself. I un-installed chrome and downloaded anew, it then worked in English fine. However, after re-booting, the full Greek Chrome has reappeared!!!.

by gerry-d (not verified) on 14. June 2012 - 5:26  (94825)

I have now noted that google ads do not appear when browsing, but they appear next to emails only. Therefore, the hosts file works for some blocks but not for the google analytics (the first four lines), which means that Google and/or Windows ignore those lines!

by gerry-d (not verified) on 14. June 2012 - 6:09  (94826)

Weird: I have now deleted from hosts the two lines

127.0.0.1 pagead.googlesyndication.com #google adds
127.0.0.1 pagead2.googlesyndication.com #google adds

but the ads still do not appear when browsing but appear next to emails.

by Lionhead (not verified) on 14. June 2012 - 16:32  (94867)

I think you're having problems for a few different reasons:

1) Hosts file doesn't work with characters, e.g., * or # Use letters or numbers only.

2) Ads in e-mails are not to be confused with ads in a browser. Apples & Oranges. Host file will not help you in trying to eliminate e-mail embedding. That is likely a server side issue with your provider.

3) Your opening yourself up to privacy issues in the Chrome browser as the software just might be coded to defeat what you're trying to do. Also, there may be issues in the search engine in your browser. Considering using one that leaves no tracks & doesn't allow tracking or third party cookies. Many are mentioned on this site for privacy.

4) I have successfully blocked the sites you mention with no problems. Today, I have also blocked the popular social media sites without any issues. Do some research into the hosts file as linked in the article to learn how to utilize it properly. A little studying, & all should be well. ;)

by gerry-d (not verified) on 13. June 2012 - 10:46  (94793)

I have used the hosts file to block reporting my visits to my own website in google analytics. As of yesterday, I noted that my visits now are visible to "Real-Time Beta" facility in google analytics. Yesterday, I noted a long session from myself at the end of the day reporting in google analytics. I have checked the hosts file and it has not been changed, i.e. all blocks are in place:
127.0.0.1 www.google-analytics.com
127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com
127.0.0.1 *.google-analytics.com

Any idea what is happening? Thanks.

by Lionhead (not verified) on 14. June 2012 - 0:52  (94816)

gerry-d, I have noticed that facebook has managed to circumvent the "restricted sites" list in IE. This also goes for another well known ad purveyor. Perhaps in your case, the great software engineers at Google have managed to get through browser defenses of the hosts file and/or restricted sites list? Putting facebook in the hosts file redirects one to the default search engine on the browser. I guess there's no way to shake them except for an all out assualt at the firewall to stop the barbarians "at the gate."

I speculate that through the process of security patches or browser updating, certain features may have been put in that are now being utilized. My hosts file local gizmo "Homer" shows the google cookies & ads getting zapped along with the micro pixel cookies of other ad sites. The total per day runs into the hundreds. These Google folks are really pushing past their welcome with such non-friendly, invasive tactics they employ.

Please keep us appraised if you find an answer. I will add the ones you posted into my hosts file.

by Riaz (not verified) on 17. May 2012 - 5:12  (93581)

Using internet exploror, goto Tools\Internet Options\Security\Restricted Sites.

Add following 2 URL and press 'Add' button.
pagead.googlesyndication.com
pagead2.googlesyndication.com

you can use similar tecnique for other web browsers.

by Lionhead (not verified) on 4. June 2012 - 21:05  (94401)

Riaz, thanks for the comment which I find to have worked perfectly without slowing down browsing performance on Internet Explorer 7. I would like to add some addresses for those that wish to persue this venue of controlling unwanted ads, malware, spyware, pop ups, and tracking outfits. The advantage of using the Restricted Sites zone is that one can use wildcard characters to shorten & provide for changes to the domain name & most importantly, to be able to utilize the actual numeric http address as a restricted site. When names or numeric addresses are put into "the zone," they're stopped completely. No ifs, ands, or buts.

The Hosts file listing requires constant maintenance of exact domain names & provides no provision for numeric http addresses that some sites are using. So, the restricted sites zones allows shortened lists with wildcard characters, numeric http addresses, and customization to the websites that one visits. Pick & choose the things you want or don't want to see.

Here's an abbreviated list of what other's have posted & a few of my own preference. You can look for the domain name by right clicking on an add to get the "shortcut" or look in your cookies for addresses you'd like to eliminate. Follow the instructions of Riaz above if you're using Internet Explorer 7-9. I think you'll find happiness even with this abbreviated list.

*.112.2o7.net
*.ad.yieldmanager.com
*.doubleclick.net
*.googleadservices.com
*.google-analytics.com
*.googlesyndication.com
*.imageads.googleadservices.com
*.pagead.googlesyndication.com
*.partner.googleadservices.com
*.pluginaccess.com

by trapiellesco (not verified) on 29. March 2012 - 9:10  (91369)

if you paste this in your host document you will get rid of all those anoying ads.

127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 partner.googleadservices.com
127.0.0.1 imageads.googleadservices.com
127.0.0.1 imageads1.googleadservices.com
127.0.0.1 imageads2.googleadservices.com
127.0.0.1 imageads3.googleadservices.com
127.0.0.1 imageads4.googleadservices.com
127.0.0.1 imageads5.googleadservices.com
127.0.0.1 imageads6.googleadservices.com
127.0.0.1 imageads7.googleadservices.com
127.0.0.1 imageads8.googleadservices.com
127.0.0.1 imageads9.googleadservices.com

by Myron (not verified) on 25. February 2012 - 6:49  (89442)

It works! Thanks for the info. I knew about the hosts file, but it never dawned on me that it could be used to block Google ads.

by Dan7845 (not verified) on 21. February 2012 - 2:41  (89155)

Ads still appear. Vista, Windows 7, IE 9.

by Venkat (not verified) on 30. January 2012 - 14:39  (88036)

Thanks for the useful info. I tried everywhere to remove these google ads but couldn't do it even with anti-virus, anti-malware programs. Now my problem is solved. See how Google is making us view their ads. Very unethical practices!

by Teo on 10. January 2012 - 14:02  (86939)

I think that much easy way to remove Google and other ads is to use Adblock Plus + Element Hiding Helper extensions which are now available for FireFox, Chrome and K-Meleon. There are also some clones for IE as well. Those extensions are blocking a lot of different ads based on subscription lists or individual rules which are not touching any system files.

by GW (not verified) on 14. January 2012 - 16:14  (87172)

Does anyone know how to do this on an Acer A500 Tablet?

by Dr.Greenberg (not verified) on 18. March 2012 - 7:54  (90784)

ROOT your device
Install Ad-Away
In your block list ad the url's above & google-analytics.com, www. google-analytics.com, ssl.google-analytics.com
Then update your hosts file to apply the url's above

by timeman (not verified) on 7. January 2012 - 19:37  (86778)

Main problem I have is slowness loading sites. I don't care whether the ads appear or not. While I'm waiting up to a minute for site to load, I always see that pagead2.googlesyndication.com text just sitting there in lower left. So I applied article advice, put in the two lines as instructed in Notepad. The lines saved properly. But the same problem persists. In fact, it's even hanging up by about a minute my attempt to preview this comment. Is there a product out there that will fix this?

by lasersquad (not verified) on 10. January 2012 - 10:16  (86931)

It`s possible your slowness might be caused by many other things, like malware or some Windows conflict.

Google has also other domains spamming like variants of googleads that always seem to sneak through. i use opera and finally got tired and blocked the very google.com/* itself. Guess what, Internet didn`t collapse and the ads are gone ;)

by sml156 (not verified) on 1. August 2011 - 0:07  (76639)

I have been useing HostMan for quite a while it does the same thing only it block's around 100,000 sites that either ads or nasty . just a tip for people that use yahoo just take the ads file and the partial file and use server as a startup service

by ACruz (not verified) on 23. May 2011 - 13:32  (72540)

I don't think we need to fiddle with the hosts file.
I'm using Firefox's BlockSite extension and it seems to work just fine.
Thank you for taking the time to write it down.
This Google's hegemony is really VERY annoying.
Cheers,

by Wiaty ogrodowe (not verified) on 5. May 2011 - 21:12  (71484)

Yeah very good solution, but as u have seen most of blogger earn some money for their informations. Novadays nothing is for free, you have to pay almost for everything!

by Flessan (not verified) on 22. April 2011 - 15:37  (70701)

Worked PERFECTLY in Windows 7 and didn't affect anything else, thanks! Path in Windows 7 was the same as Windows 2K, XP, 2003, Vista (C:\WINDOWS\system32\drivers\etc). As mentioned by pdfcayman, open notepad as administrator, then do a file/open and browse to the file. The file HOST does not have an extension, so be sure to select all files from the drop down list so you can see it.

Flessan

by Google is now an evil virus (not verified) on 11. January 2011 - 17:46  (64296)

Does not work for domains.googlesyndication.com
WHY?

by notvalidname (not verified) on 6. December 2010 - 11:06  (62088)

is there a way to remove the google ads on top of your gmail? it seems the feed isn't coming from the page#.googlesyndication.com.
it is really annoying as it is based on your email content and just like stealing things in front of you.

by ianjrichards (not verified) on 6. December 2010 - 20:38  (62119)

No, these ads are embedded in the page HTML and cannot be removed using any technique I'm aware of. - Gizmo

by Fidani (not verified) on 19. November 2010 - 0:11  (61367)

thank you <3.

by pdfcayman (not verified) on 25. August 2010 - 4:51  (56678)

The easiest way to edit the HOSTS file and save it in Windows 7 is to right click on Notepad and select "Run as Administrator". You can then browse to and File/Open HOSTS, edit it and save it without amending security settings which can compromise security in your computer. HOSTS is protected because malware can and will use it if it can to redirect your web access. This is why you cannot simply navigate to it, double click to open it and then save your edits.

Gizmo's Freeware is Recruiting!

Gizmos Needs YouShare your knowledge of free software with millions of Gizmo's readers by joining our editing team.  Details here.