Remove Google and Yahoo Ads
Update (2007-01-31): Included a fourth (Windows hosts) method for getting rid of ads.
More and more sites are displaying Google (AdSense) or Yahoo (YPN) ads. I thought I’d post up 4 simple ways you can get rid of these ads, and, if like me, you’d still like to know which sites use them but don’t really want to see the ads, there’s even a solution to replace them with boxes. Solutions 1-3 require Firefox. Solution 4 should work with any browser on a Windows system.
Note: these solutions are targeted at Google and Yahoo ad services, to remove other ads you can follow the steps in my ad-free browsing guide. Solutions 1, 2 and 4 only remove the ads, solution 3 also replaces them with boxes where the ads would have appeared.
Solution 1. AdBlock Plus extension
Install Adblock Plus and add the following two filters:
http://ypn-js.overture.com/*
and
http://pagead2.googlesyndication.com/*
If you’re already running AdBlock Plus, you can subscribe to my Google and Yahoo ad remover filter set.
Solution 2. CSS—no additional addons required
Edit userContent.css (use ChromEdit Plus or read Editing Configuration Files if you need help) and add the following two rules:
/*
* Remove Google ads
*/
iframe[name='google_ads_frame'],
a[href^='http://pagead2.googlesyndication.com']
{ display: none ! important; }
/*
* Remove Yahoo ads
*/
iframe[src^='http://ypn-js.overture.com']
{ display: none ! important; }
Save and restart Firefox.
Solution 3. Replacing Ads with Greasemonkey
Install Greasemonkey and then my Replace Google/Yahoo Ads script.
Before and after screenshot:
![[2 screenshots]](/wp-content/images/2006-replace-ads.gif)
Solution 4. Windows hosts
This is based on Tech Support Alert’s in-depth guide to Removing Google Ads Using the Windows Hosts File. Read that if you’re unfamiliar with the Windows Hosts file.
Locate the hosts file. It’ll be found in one of these locations, depending on your version of Windows:
Windows XP = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K/NT = C:\WINNT\SYSTEM32\DRIVERS\ETC
Windows 98/ME = C:\WINDOWS
Open it with a plain-text editor, e.g. Notepad, and add the following two lines:
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 ypn-js.overture.com
Any feedback appreciated.
Ads on Google and Yahoo websites
The solutions above will not block ads appearing on Google or Yahoo’s own websites, e.g. Gmail or Yahoo Mail, as most of those ads are fetched server-side and not through the HTML snippets most webmasters receive when signing up to AdSense/YPN. You will however find Firefox extensions and Greasemonkey scripts targeting those sites specifically. For example, the excellent CustomizeGoogle extension removes ads from Google search results, GMail, and more.

Nice and easy solutions, specially the one with the hosts.conf file.
i edited the hosts file but i still see google ads
Anonymous: These methods will only remove Google Adsense ads used by webmasters on their own sites. They won’t remove Google ads found on Google’s own sites (e.g. GMail - you’ll have to use the CustomizeGoogle extension for that).
If it is the adsense ads you’re trying to remove, make sure you edit the hosts file as described, save it, restart your browser and clear the browser’s cache. Then try loading a page with Adsense ads, e.g. adsenseguide.info. If you’re still having problems, let me know which browser you’re using.
Thanks!!!! it was very helpful….I’m sending this to all my friends who are also sick of seeing these google ads EVERYWHERE…thanks again
It is great tricks indeed, Thank you a lot for this Keyvan!
Thanks , I tried css solution and it works.
I edited the hosts file and even though I don´t see the ads themselves I still have this vertical strip that says “page not found”. It´s really annoying cause its practically in the middle of the page i´m trying to see. Anyway to get rid of that, too???
Thanks for the comments - I’m glad these are working for most of you.
Claudia: Which browser are you using?
Use a white background to the replaced Ad area !
Thanks bunches for this. I’ve been having horrendous problems the last few weeks with trying to get some sites to load. What a pain!

The adblocker add-on for firefox worked great though.