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
Delicious
Digg
StumbleUpon
Please rate this article


Subscribe to our
Its easy if it blocks something u want,just open hosts in notepad,and take out the domain u want,or use hostman,is easier,or host manager.U can replace the ads with pics or words,whatever u want if u use a local server.One comes with hostman,or use homer.Have been using for years,brilliant.Using localserver will speed up browsing if u have a large host file.Main reason for host really is to block bad websites that give u viruses/malware.Blocking ads is just extra really.
I use Adblock Plus and NoScript in Firefox to block any type of ads, including those of Google.
After seeing too many Google text ads, I decided to give this a try.
I've one page open with an ad, adding the two lines as you said, open the same page again and the ad is gone. It works like a charm.
Thanks Gizmo.
p.s. It works on Win 7 too, same location as XP and Vista.
The thing used to work fine on XP. I recently changed to vista and tried the same procedure but it is not working. The last line just above where I pasted the pagead.googlesyndication.com says'::1 localhost' . Is this making it not work. Help.
VISTA home basic.
I followed directions, went here C:\Windows\System32\drivers\etc opened hosts in notepad, cut & pasted the two lines (no spaces) and it wouldn't save. Took a hint from Anon. #4, and here is specifically what worked (shout out to the computer dummies!):
I R-clicked hosts, went to properties and then security, hit 'edit' under change permissions, highlighted Administrator and clicked 'allow' for everything.
Then I followed the instructions again and worked fab - THANK YOU GIZMO
this stupid thing worked so the adds went away but so did the entire facebook,and nothing works anywhere now.
so how i remove this and get it back to normal before i followed this idiot idea
HOw Do I get rid of this crap with the ads popping up and blocking information on the website Im on.!! Example: Facebook
PLease help and thanks :)
If there is error messages in the places where the ads use to be, just unchek "show friendly HTTP error messages" in internet options advance tab.
and please guys stop unloading free spy software.
I needed to take ownership on my vista hosts file before it would save. Kept whining about "locked by another application" Luckily, I have the "take ownership" item in my context menu enabled so I just right clicked, took ownership and saved it. Works like a charm
Hello hello from greece
this article worked also for me to get rid of the stupid/f****ng google ads, that comes with some blogger templates.
just go the edit html tab, on blogger menu
and within the code search for the phrase pagead.googlesyndication.com
erase the whole sentence and VOILAAAAAAA no ads included in your theme.
thank u mate and have a great day
Does anyone know how to find the google T5 browser bar, apparently this is blocking access to the plentyoffish.com site according to their open forum. I don't even know if windows 2000 has the T5 bar I can't seem to locate it. I've always used google as my main search engine and have used POF site for a year and no problems. I just fixed the googlesyndicate issue thinking that was causing my problems with POF but it doesn't seem to have helped any. Anyone else out there having these issues?
I used to use the hosts file when I had dial-up and stopped when I got broadband. I decided to give a try to the suggestion for just pagead.googlesyndication.com and pagead2.googlesyndication.com. What I found were long pauses while my browser was trying to access one of those sites. It's like it is waiting to receive something from the site and then times out when it does not receive it. I commented out the 2 lines in the hosts file and then I had no pause while it was trying to access those sites.
I still use Win2k.
My C:\WINNT\system32\drivers\etc folder has no file called hosts (I have checked that it not hidden), but does have a file called lmhosts.sam which consists only of comments (every line starts with #) about the hosts file. It is presumably not the hosts file itself, which has no file extension, you say. However, it says
# This is a sample LMHOSTS file used by the Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to computernames
# (NetBIOS) names. Each entry should be kept on an individual line.
# The IP address should be placed in the first column followed by the
# corresponding computername. The address and the computername
# should be separated by at least one space or tab. The "#" character
# is generally used to denote the start of a comment (see the exceptions
# below).
It also advises at the end of about 80 lines:
# Note that the whole file is parsed including comments on each lookup,
# so keeping the number of comments to a minimum will improve performance.
# Therefore it is not advisable to simply add lmhosts file entries onto the
# end of this file.
However, it doesn't say where to put them instead!
Can I just create a text file called hosts, or what?
(oddly, the .sam extension is not defined in the list of file types in folder options)
Love your site and have used it a lot, despite my lack of expertise!
For Windows 2000 the HOSTS file is located in the C:\WINNT\SYSTEM32\DRIVERS\ETC or C:\WINDOWS\SYSTEM32\DRIVERS\ETC folder.
If you don't have one in either folder then create one, the first line must be "127.0.0.1 localhost".
See: http://www.wikihow.com/Use-a-Hosts-File-in-Windows
I did all that was recommended and it went fine but when saving from Notepad it wants to save as a text file which seems to be fundamentally different from the original Host file. What does it need to be saved as other then what seems to be available from/through Notepad.?
...figured it out....don't save as the default Notepad .txt file but choose All Files from the dropdown then select Host, then it prompts to replace existing....good information to be included in the process.
Great article Gizmo. Very well explained and useful information!
I've been using HostsMan for years, and I think it's the best way to manage your hosts file. Stable, free, easy to use, and with automatic updating enabled, you don't have to think about it. This should be in your recommended list, Gizmo, or at least reviewed.
http://www.abelhadigital.com/
Firefox with Addlock Plus does it automatically - the majority of people visiting my sites use Firefox and ADP is the most popular add-on so it's no wonder I make so little from the ads on my site!
No one mentions the best Hosts file manager HostsMan?
http://www.abelhadigital.com/
Features:
Automatic update of hosts file
Enable/Disable hosts file
Built-in hosts editor
Scan hosts for errors, duplicates and possible hijacks
Hosts file backup manager
Exclusion list
Local HTTP server
Absolutely
Been using this product for years now.
Pat
Thank you, you are the best!!
jeremy
Wow! Quick, easy and very well explained. If you can't follow these instructions, you just aren't paying attention.
Great piece(s) of information and a well explained definition of "host(s) files in plain, simple and non-geek (sorry) English.
My day is complete now that I've learned something new.
All the replys are very informative as well. Thanks to all.
bud6642
I used a Proxy Auto Config file. I like it better than editing the host file.
writeup here on how:
http://www.schooner.com/~loverso/no-ads/
I can also easily turn it on/off.
I tried and triedto edit the Hosts file as described -- but Notepad wouldn't save the edited file. Finally, after Googling up on how to edit hosts file, I found the solution -- which presumably will help others. When I right-clicked on the Hosts file, then clicked "Properties", the "read-only" box was checked. Apparently, lots of security software will do that to protect malicious programs from modifying the hosts file. Anyway, I unchecked the box, hit "apply", modified the file, then switched "read-only" back on. Hope that helps others as well!
I use a hosts file on my home computers to block ads containing flash and images mainly because I'm on a slow connection (dial-up) and it speeds up my browsing enormously. But even if I had a fast connection I'd still use one to eliminate adult ads, spyware etc.
The benefits far outway the only disadvantage (i.e. not being able to go to a blocked site without editing the hosts file) and I now recommend it to other people I know (especially those with kids).
I first saw this tip on http://www.techsupportalert.com a while back and have used it ever since.
Thanks!
http://webisee.com/2008/08/02/block-ads-on-internet-explorer-and-firefox... has other solutions for blocking ads in Internet Explorer and Firefox.
Might I suggest the Customize Google extension for Firefox? It also has quite a few more useful features besides the ad-blocking.
Great article Gizmo. Thanks a lot :).
What about VISTA?
The location of the HOSTS file for Vista is the same as XP. If you can't locate your HOSTS file just do a Windows search for "HOSTS"
Tried this but did not work. Your instructions are not specific enough. The last two lines at the end of my Hosts file are:
# This list is Copyright 2000-2007 Safer Networking Limited
# End of entries inserted by Spybot - Search & Destroy
I tried entering the text you specified both above and below these last two lines. Doesn't work either way. I get an error message that says can't create Hosts file.
R.C.
I have the same thing in my hosts file. Don't try to insert the two lines at the end of the file -- instead you need to go to the top of the file and insert them *before* the spybot entries, ie at the end of the block that begins with the localhost line.
...Or else do what Gizmo says -- which now that I think about it, is probably more likely to be the cause of your problem.
excellent article. btw, nobody should pay attention to the comment by anonymous on 4/22/09 at 14:52. Its intentionally misleading about this fix causing problems, probably a google marketing flunky trying to poison this article.
cheers
Sounds like your security software won't allow alteration of the HOSTS file. Try disabling you software or boot in Safe mode.
Good stuff Gizmo - Glad I subscribed to you.
Roger C
Have you ever seen IntelliTXT ads? These are links with a double underline that popup a "bubble" when you mouse over them. I personally don't like web pages that are all cluttered up with flashy ads like that so I got rid of them using this same HOSTS file method. All you do is view your page source (press Ctrl+U in FireFox) and search for the word IntelliTXT in the code that you see. If you don't know how to read all that code, don't worry, you only need to find the address and won't need to understand or modify anything in there. When you find it you should notice that it is actually part of a web address (something.intellitxt.com for example). If you add an entry in your HOSTS file like this:
127.0.0.1 something.intellitxt.com
it will get rid of the "popup bubble ads" for you. You may not see it take effect right away or if you just refresh the page, this might be because the true address of "something.intellitxt.com" is stored in your DNS cache. To clear it out of your DNS cache you open a DOS window (sometimes called Command Prompt) and type in ipconfig /flushdns. This requires that your "DNS Client" service is running but unless you have specifically gone and turned that off it should be just fine.
Now those of you who have been using this HOSTS file trick may find that you see a lot of error messages in the places where the ads used to be (explaining that your browser can't contact the web server). This is because when you point your HOSTS file to 127.0.0.1 it means to look on your local PC. If your local PC is not a webserver then your browser gives you these messages. There is a nifty little utility called Homer that can clean up those error messages. It is a small application that turns your local PC into a webserver. It can be configured to always return an empty image file to your browser. That way when you block something with your HOSTS file your browser will display an "almost invisible" dot instead of an error message... which makes pages with lots of ads look much cleaner!
Thanks a lot for the tip Snork... those popup bubble ads really are a menace.
Thank you Snork
than Q
http://accs-net.com/hostess/ according to the site owner this link is two years out of date!
Try here: http://www.raymarron.com/hostess/
G'day!
The link has been updated
Post new comment