Home > ramiro's blog > How to Avoid GoogleAds Display

How to Avoid GoogleAds Display

No GoogleAds Google recently penalized link networks and web sites that sell or buy links by decreasing their PageRanks. To be more precise: sites that sell or buy links on their own or via link brokers such as Text Link Ads. These methods of link marketing do not comply with Google's Webmaster Guidelines, in contrast to buying Google AdWords or integrating Google AdSense on your site.

To get rid of Google's own ugly paid link advertising, that often points to useless spammy looking sites you can use the following methods discussed in this article:

  • Use redirects in your system's hosts file.
  • Turn off JavaScript support in your browser.
  • Use the NoScript extension for Firefox.
  • Use the Greasemonkey extension for Firefox.
  • Use a Proxy such as Privoxy.
  • Stop using Google.

Redirects in your hosts file

This method is pretty straight forward, available on all systems and works with all browsers. The hosts file stores information on where to find a host in a network and maps host names to IP addresses.

You find this file in the following locations depending on your operating system:

Windows NT/2000/XP/Vista:
%SystemRoot%\system32\drivers\etc\hosts
%SystemRoot% in most cases is C:\WINDOWS
Linux/Unix:
/etc/hosts
Mac OS X:
/private/etc/hosts

You can edit this file with your favorite text editor and add the following lines to not display GoogleAds:

# [GoogleAds]
127.0.0.1  pagead.googlesyndication.com
127.0.0.1  pagead2.googlesyndication.com #[Google AdWords]
127.0.0.1  adservices.google.com
127.0.0.1  imageads.googleadservices.com #[Ewido.TrackingCookie.Googleadservices]
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
127.0.0.1  partner.googleadservices.com
127.0.0.1  www.googleadservices.com
# [Google Analytics]
127.0.0.1  apps5.oingo.com #[Microsoft.Typo-Patrol]
127.0.0.1  www.appliedsemantics.com
127.0.0.1  service.urchin.com #[Urchin Tracking Module]
127.0.0.1  ssl.google-analytics.com #[urchinTracker]
127.0.0.1  www.google-analytics.com #[Google Analytics]

This will redirect requests to your local machine. Check this example hosts file if you want to block more advertising providers and spam sites.

Turn off JavaScript

Turning off JavaScript entirely in your browser comes with advantages and drawbacks. Pages will load faster and ads embedded via JavaScript, such as GoogleAds, won't display. Unfortunately many sites will not work at all without JavaScript support.

NoScript extension for Firefox

This is my personal favorite. The NoScript extension for the Firefox Web browser allows you to turn off JavaScript based on the location of the JavaScript source code. You can turn off sources such as pagead.googlesyndication.com and turn on JavaScript support for other sites.

Greasemonkey extension for Firefox

With Greasemonkey you can add your own JavaScript code to sites and pages by specifying URLs that may include wildcard characters (e.g. *) to apply the script to whole sites. To apply a script to google.com and google.de SERPs, you can enter the URLs http://www.google.com/* and http://www.google.de/*.

To not display GoogleAds on the Google SERPs add the user script below and apply it to the URLs above.

// ==UserScript==
// @name           NoGoogleSearchAds
// @namespace      NoGoogleSearchAds
// @include        http://www.google.com
//
@include        http://www.google.de
//
==/UserScript==
var ads = new Array('mbEnd','tads','tpa1');
for (a in ads) {
  var ad = document.getElementById(ads[a]);
  if (ad) {
    ad.style.display = 'none';
  }
}

After doing so the search result page for the search term viagra looks like below.

viagra Google Search

Use a Proxy such as Privoxy.

Privoxy is a web proxy offering capabilities for protecting privacy. In addition it removes ads, banners, pop-ups and other Internet junk, such as GoogleAds.

Stop using Google

Last but not least: Stop using Google. This may be the toughest decision, if you make money form AdSense, get traffic via AdWords or use any other services provided by Google, such as it's nice search engine. A clear benefit is: Google doesn't collect your data.

If you go for this option, I recommend using the hosts file and enter all URLs to Google services in it, redirecting to your localhost.

Any other methods you can think of? Feel free to post them in your comment.

Spot the Difference

Compare the myspacedev.com music icon list once with GoogleAds and once without.

MySpace Dev with GoogleAds

MySpace Dev with GoogleAds

MySpace Dev without GoogleAds

MySpace Dev without GoogleAds
Google really are sending out mixed signals, which most people are interpreting as being one set of rules for Google advertising and rules for everyone else. I also dumped AdSense recently, mostly because the feedback I got from a quick usability survey showed that those asked thought it detracted from the 'blog. Plus, I was hardly making any money from AdSense, even though the adverts where really well targeted...
Thanks for this tip. I never knew we could hide Google ads and this will certainly allow us to surf faster and clean all these ugly ads.

You won't recognize your own site after turning off GoogleAds display ;-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <img> <h2> <h3> <h4> <h5>

More information about formatting options

Loading