Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Stop all advertising banners in web browsers Web Browsers
I've made a summary with all information about CSS and ADS blocking. The result is an CSS file which, used as default style sheet, can hide all advertising banners in images, texts or animations format even embeded into javascript! This works of course with all browsers ...except Internet Explorer! But who cares?

You can find the stopADVbanners.css file on my website. Just save this file on your hard drive then open the preferences panel of your favorite browser (Mozilla, Netscape, Apple Safari, Opera, etc) and choose this file as "preferred style sheet".

Some very easy CSS tricks I used:
/* disable ad image linking to advertising script */ 
A:link[HREF*="doubleclick"] IMG,

/* disable ad texts linking to advertising script */ 
A:link[HREF*="?banner"],

/* disable Flash banner ads */ 
embed[type*="shockwave"][width="468"][height="60"], 
object[codebase*="shockwave"][width="468"][height="60"],

/* disable ad iframes */ 
IFRAME[SRC*="valueclick"],

/* disable ADV images as specified by www.iab.net */ 
*[width="468"][height="60"], *[width="468px"][height="60px"]

{ display: none !important; visibility: hidden !important; }
[robg adds: Here's my obligatory webmaster comment ... if you block all ads all the time, those sites that rely on ad revenue may eventually start charging for access (see recent warnings on Macintouch, MacSurfer, etc.). I leave most ads enabled, only blocking pop-ups and highly annoying Flash ads, and occasionally buy stuff via click-throughs just to support my favorite sites ... one could argue the merits of the advertising-supported web model forever, though, and this hint does provide some good solutions to blocking highly annoying ads.]
    •    
  • Currently 3.13 / 5
  You rated: 2 / 5 (8 votes cast)
 
[39,721 views]  

Stop all advertising banners in web browsers | 32 comments | Create New Account
Click here to return to the 'Stop all advertising banners in web browsers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Blocking ad display, not download
Authored by: rootpoot on Sep 15, '03 11:18:04AM

With CSS methods, you're still downloading the ad files. This has two important implications.

1) Your're not saving any bandwidth.
2) The webmaster has no idea that you chose not to display the ad. As far as they know, they got the impression.



[ Reply to This | # ]
Blocking ad display, not download
Authored by: VEGx on Sep 15, '03 11:21:55AM

Well, I don't know WHAT happened, but... I had another css file before that was supposed to colour LINKs... so maybe that was the culprit... but with this css my pages RENDER much faster.

Either way, if it was because of the ads blocking or because of replacing the old css file... I'm happy I tried the file provided by the author of this post!! :)
Thank you.



[ Reply to This | # ]
Blocking ad display, not download
Authored by: patashnik on Sep 18, '03 07:22:04AM

According to a small test I did, I have to conclude that Safari does _not_ download the contents of remote resources within a 'display: none' block (like a DIV or a SPAN), so it will surely save you bandwidth.



[ Reply to This | # ]
My user CSS file
Authored by: rootpoot on Sep 15, '03 11:54:29AM

My userContent.css file does pretty much the same thing.

I like to block Flash content from displaying initially, since 90% of the time it's only going to annoy me. Note that XBL only works in Gecko-based browsers.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: pcunix on Sep 15, '03 02:22:15PM

In addition to Rob's comment (yes, my website depends on advertising
revenue also), I'd like to add that context based ads such as those served by Google aren't always a bad thing. I note that on my own site the ads that appear on the techy articles are often quite relevant and I think that they actually ad to the value of the material.



---
--
Tony Lawrence
Free SCO, Mac OS X and Linux Skills Tests: http://aplawrence.com/skillstest.html



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: floppymoose on Nov 17, '03 12:25:05AM

Note that Google contextual ads, since they aren't images, aren't blocked.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: floppymoose on Nov 17, '03 01:55:56AM

oops. I see Google ads are (sometimes? always?) placed in iframes now, and indeed are blocked by my iframe ad blocking rules. If you want to turn back on the Google contextual ads, make a new selector for the rule at the end of my userContent.css that looks for "googlesyndication". That last rule is for turning specific blocked content back on.



[ Reply to This | # ]
Shotgun Approach
Authored by: jca on Sep 15, '03 03:33:51PM

Speaking as another webmaster/designer, this seems like a bad method for trying to remove web advertising. Looking at the CSS file, it seems many legitimate content could get snagged by this broad approach - and considering no browser/site handles CSS the same way as the other, there is sure to be some problems.

Besides, with great sites like MacInTouch struggling to survive, why take away the only thing keeping them alive? This sort of thing will provoke more sites to pull a dreadful ign.com McDonalds style ad makeover.



[ Reply to This | # ]
Shotgun Approach
Authored by: La Shampoo on Sep 15, '03 05:25:34PM
As Rootpot said: " With CSS methods, you're still downloading the ad files. The webmaster has no idea that you chose not to display the ad. "

Ad stats are not based on ADS display but on ADS downloads. So the ADS stats remain the same and the revenues won't disappear. There is no way to guess what CSS file visitors are using, no way for the AD agencies to guess if the downloaded file will be display or not.

[ Reply to This | # ]
Shotgun Approach
Authored by: jca on Sep 18, '03 03:49:51PM

No, this is incorrect. Revenues and ad stats are not based solely on "impressions" - that's not how most ad programs work. Simply "downloading" the ad will not bring any revenue to the publisher, in fact, it will hurt them greatly, because it will throw off the stats/ratios, and they will move on to other methods, such as pop-unders, or the aforementioned "site makeover" a la IGN.com.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: La Shampoo on Sep 15, '03 05:37:08PM
As Rootpot said: " With CSS methods, you're still downloading the ad files. The webmaster (like ADS agencies) has no idea that you chose not to display the ad. "

In response to Robg: Ad stats are not based on ADS display but on ADS downloads. So the ADS stats remain the same and the revenues for the website won't disappear. There is no way to guess what CSS file visitors are using, no way for the ADS agencies to guess if the downloaded file will be display or not.

[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: phc on Sep 15, '03 07:39:22PM

I was trying to figure out a practical use for attribute matching with CSS, and I guess this is one of them. Although I think banner ads and such are fine but the ones that just try to annoy you is why tips like these come up. I can't stand the flashing "WINNER" ad or the one that looks like a Windows dialog box that keeps shaking around.



[ Reply to This | # ]
privoxy
Authored by: sn00py on Sep 16, '03 03:51:57AM

What's the difference between this method and using a utility like privoxy (www.privoxy.org) ?
Is one way more efficient, more flexible? What are the (dis)advantages?
Thanks



[ Reply to This | # ]
How to stop thinksecret flashing advertising banners
Authored by: IslandDan on Sep 16, '03 10:56:47AM

Any idea of how to stop those "flashing" ads on thinksecret.com?

Hey, they are counter-productive since they are so annoying I don't go to that site and weoul dnever click on such an ad.

Frankly, any site that has such obnoxious ads deserves an object lesson.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: La Shampoo on Sep 16, '03 01:13:33PM
The difference between "Privoxy" ? This is just a simple CSS text file so it's:
- very easy to use on any 'good browser' (means no MSN IE), no system or platform related, no internet setting to change
- customizable (you can remove the unwanted tags referring to your favorite website or add more)
- undetectable (you download as many banner as anyone, so no webmaster will ever notive you don't display their ads)

[ Reply to This | # ]
blocking ads is a good thing
Authored by: baba on Sep 16, '03 04:33:57PM
I'm not sure using a stylesheet is the best solution, but if it blocks ads the user does not want to see, that's a good thing. Trying to force ads on users who explicitly don't want to see them is pointless and serves only to cultivate an adversarial atmosphere. Often overlooked is the possibility that a certain user who generally does not want to see ads may indeed want to see them at, say, a certain geek site that has established its goodwill by serving only small static ads for relevant goods or services. My beef with most browsers is that they refuse to offer this flexibility. Hence, to my mind, Mozilla is Netscape is IE is Safari is Camino is OmniWeb and so on.

[ Reply to This | # ]
How do I add to this?
Authored by: ServaasX on Sep 16, '03 04:56:05PM

Like a weblink or a filter?

Servaas



[ Reply to This | # ]
How do I add to this?
Authored by: ServaasX on Sep 16, '03 04:58:05PM

Like a weblink or a filter?

Servaas

PS: sorry for the double post. First time user.



[ Reply to This | # ]
Wiped out my own web page
Authored by: hmelton on Sep 17, '03 11:10:10PM

I tried it, but then I noticed my home page was missing the big image map I used for site navigation. Oh, well.



[ Reply to This | # ]
Wiped out my own web page
Authored by: hmelton on Sep 17, '03 11:25:23PM

It was the last section where any image of a certain size get's wiped out. I guess to avoid being zapped, I'd have to make sure any image on my site has odd-ball sizes.

I think I'll vote against this hint.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: simX on Sep 18, '03 12:33:37AM

Does anybody know how to add entries to the CSS file so that it allows Flash content from certain sites (like homestarrunner.com :) )? That would be very useful. I tried creating some based on what was already given in the CSS file, but homestarrunner.com was still blocked. Any help would be greatly appreciated.



[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: vman on Sep 18, '03 07:48:37PM
I've been using PithHelmet a while now, another ad-stopper utility for Safari, works great.

[ Reply to This | # ]
Stop all advertising banners in web browsers
Authored by: GaelicWizard on Feb 08, '04 01:59:21AM

PithHelmet is an ugly hack. With this method you miss a few, you catch a few you shouldn't, just like PithHelmet, but you NEVER make Safari crash because of it. Oh, but you get some pretty icons and a pref-pane, so that means its worth it...

JP

---
Pell



[ Reply to This | # ]
I've been running PithHelmet for months
Authored by: gaudior on Feb 08, '04 09:41:08AM

And I have never had Safari crash because of it. You describe it as an 'Ugly Hack'. Just exactly what do you mean by this? It is certainly nowhere near as intrusive as Unsanities Haxies.



[ Reply to This | # ]
hacks is hacks
Authored by: sjk on Mar 15, '04 06:43:30PM

Frankly, some of the "obscurely geeky" ways people tweak Mozilla-based browsers seem more like "ugly hacks" to me than PithHelmet. ;-)



[ Reply to This | # ]
Can also block legitimate images!
Authored by: danb5 on Oct 09, '03 06:52:20PM
This technique is a bit draconian -- for instance, the page at www.mileageplusmall.com or a typical page at PriceGrabber strips out the logos, which is the only way to identify the companies! My suggestion is to take out the part of the file that identifies images soley by size.

[ Reply to This | # ]
FIXED! was: Can also block legitimate images!
Authored by: floppymoose on Nov 16, '03 05:28:24PM
LaShampoo's ad blocking css is based on my original ad blockng css which you can find at http://www.floppymoose.com.

If you use mine, you will see a LOT fewer legitimate images being blocked. All those of you who tried it and had trouble should try the simpler userContent.css at the address above. I tried several of the problem sites listed in this thread and had no trouble with my userContent.css.

It would have been nice if LaShampoo had a comment in his css saying it was based on mine - then maybe those of you who had problems could have found some relief. I requested that he do this, but for reasons I don't understand he refuses.

[ Reply to This | # ]
FIXED: Stop all advertising banners in web browsers
Authored by: floppymoose on Nov 16, '03 05:34:57PM
LaShampoo's ad blocking css is based on my original ad blockng css which you can find at http://www.floppymoose.com.

If you use mine, you will see a LOT fewer legitimate images being blocked. All those of you who tried it and had trouble should try the simpler userContent.css at the address above. I tried several of the problem sites listed in this thread and had no trouble with my userContent.css.

It would have been nice if LaShampoo had a comment in his css saying it was based on mine - then maybe those of you who had problems could have found some relief. I requested that he do this, but for reasons I don't understand he refuses.

[ Reply to This | # ]
Another...
Authored by: robg on Feb 17, '04 10:46:07AM
Submitted as an anonymous tip, no email, so I'm commenting here:

An excellent CSS file which blocks a large amount of ads is available here. (This may change soon due to the name change from Mozilla Firebird to Firefox. Google cache here)

(If both the above URL's fail, simple google for adblock css)

Copy and paste the code into a file, name it adblock.css say. Then in Safari go to Preferences, Advanced, and Stylesheet select Other... and browse and select adblock.css.

Restart Safari and notice a huge visible reduction in ads as you surf.

(Original tip from http://www.efritz.net/safaritricks.html, modified to use the vastly superior Firebird CSS)

I haven't tested this file...

-rob.

[ Reply to This | # ]
Another...
Authored by: floppymoose on Mar 15, '04 12:39:59AM

You don't have to restart Safari. It applies new stylesheets immediately.



[ Reply to This | # ]
Another...
Authored by: ryanmathus on Jun 30, '04 02:40:09PM
Yet another way of blocking 99% of ads in Safari. Here's a quick and easy way to block more ads on webpages using Safari. Copy and paste the code below into AppleWorks or some other text editor (TextEdit doesn't seem to like it, though) and save it as UserContent.css in your ~/Library/Safari/ folder. The code below is from http://texturizer.net/firefox/adblock.html


/* Block Ads v.2004-06-12 by Neil Jenkins
   Portions of this ruleset are derived from the ad blocking css by Joe Francis at:
   http://www.floppymoose.com/
   Some code also contributed by Mike Hokenson:
   http://www.gozer.org/mozilla/ad_blocking
*/ 

iframe[width="120"][height="600"], a img[width="120"][height="600"],
iframe[width="125"][height="600"], a img[width="125"][height="600"],
iframe[width="150"][height="100"], a img[width="150"][height="100"],
iframe[width="150"][height="600"], a img[width="150"][height="600"],
iframe[width="160"][height="600"], a img[width="160"][height="600"],
iframe[width="300"][height="250"], a img[width="300"][height="250"],
iframe[width="336"][height="280"], a img[width="336"][height="280"],
iframe[width="468"][height="60"],  a img[width="468"][height="60"],
iframe[width="470"][height="62"],  a img[width="470"][height="62"],
iframe[width="728"][height="90"],  a img[width="728"][height="90"],
iframe[width="730"][height="92"],  a img[width="730"][height="92"],
iframe[width="600"][height="120"], object[width="125"][height="300"],
iframe[width="180"][height="150"],
iframe[src*="/ad-"],
iframe[src*="/ad."],
iframe[src*="/ad/"],
iframe[src*="/ad_"],
iframe[src*="/adframe"],
iframe[src*="/ads"],
iframe[src*="/adv"],
iframe[src*="/adx"],
iframe[src*=".ad"],
iframe[src*="_Banner"],
iframe[src*="BET365"],
iframe[src*="/click"],
iframe[src*="?click"],
iframe[src*="googlesyndication"],
iframe[src*="promos"],
iframe[name="bsadframe"],
iframe[id="adFrame"],
iframe[id="splashFrame"],
img[src*="/ad-"],
img[src*="/ad."],
img[src*="/ad/"],
img[src*="/ad_"],
img[src*="/ads"],
img[src*="/adv"],
img[src*="/adx"],
img[src*=".ad"],
img[src*="_ad_"],
img[src*="/click"],
img[src*="?click"],
img[src*="Editorial_Promos"],
img[src*="/toms_skyscraper_"],
img[src$="images/logos/amazon_international.gif"],
img[src*="freshmeat.net/button.gif"],
img[src*="pic.geocities.com/images/"],
img[src*="i.imdb.com/Vpics/"],
img[src*="i.imdb.com/Photos/CMSIcons"],
img[src*="i.imdb.com/Icons/apix/"],
img[src*="i.imdb.com/Icons/kpix/"],
img[src*="i.imdb.com/apix/"],
img[src*="sportsbybrooks.com/farkbutton.gif"],
img[alt*="advert"],
img[alt*="Click Here To Visit Our Sponsor"],
img[alt*="Sponsored Links"],
img[name="fixedSpImg"],
a:link[href*="/ad-"] img,
a:link[href*="/ad."] img,
a:link[href*="/ad/"] img,
a:link[href*="/ad_"] img,
a:link[href*="/ads"] img,
a:link[href*="/adv"] img,
a:link[href*="/adx"] img,
a:link[href*=".ad"] img,
a:link[href*="/banner"] img,
a:link[href*="/click.cgi"] img,
a:link[href*="/clickcgi?"] img,
a:link[href*="/clickover"] img,
a:link[href*="/clickthr"] img,
a:link[href*="/click-"] img,
a:link[href*="=click"] img,
a:link[href*="?click"] img,
a:link[href*="/A="] img,
table table table[width="346"][height="280"],
table[class="metatable"],
table[id="RefAd"],
table[cellspacing="0"][width="160"][height="329"][bgcolor="#000000"],
table[cellpadding="5"][width="150"][style="border: 1px dashed rgb(221, 170, 170); background-color: rgb(236, 248, 255);"],
table[border="0"][height="600"][width="120"],
table[height="90"][cellspacing="0"][cellpadding="0"][width="728"][border="0"],
table[border="0"][cellpadding="3"][cellspacing="0"][height="40"][width="100%"],
table[border="0"][cellpadding="0"][cellspacing="4"][align="right"][width="20%"],
table[border="2"] td[valign="top"][bgcolor="#ffffff"] table[width="138"],
table[border="0"][cellpadding="1"][cellspacing="0"][width="626"][bgcolor="#6699cc"],
table[bordercolor="red"][height="225"][cellspacing="0"][cellpadding="0"][width="190"][bgcolor="white"][border="0"],
table[width="336"][border="0"][cellspacing="0"][cellpadding="0"][align="right"][style="margin-left: 10px; margin-bottom: 10px;"],
table[width="770"][border="0"] tr[valign="top"]
td[width="160"],
td[class="cnnNavAd"],
td[class="RHBarBody"],
td[class="sl-table"],
td[style="border-bottom: 1px solid rgb(204, 204, 204); padding: 7px 3px; background-color: rgb(255, 254, 249);"],
td span[class="aoltextad"],
form[name="frmLargeForm"],
form[action*="click_lx.cgi"],
form[action^="http://rd.yahoo.com/"],
form[action=""][name$="SoapCity"],
form[action=""][name^="728x90"],
form[action=""][name^="300x250"],
form[method="get"][action*="martindale"][name="MDH"],
embed[type="application/x-shockwave-flash"][src*="_Banner"],
embed[type="application/x-shockwave-flash"][src*="/ad"],
embed[type="application/x-shockwave-flash"][href*="/ad"],
embed[type="application/x-shockwave-flash"][src*=".ad"],
embed[type="application/x-shockwave-flash"][href*=".ad"],
embed[type="application/x-shockwave-flash"][src*="?click"],
embed[type="application/x-shockwave-flash"][href*="?click"],
embed[type="application/x-shockwave-flash"][src*="/click"],
embed[type="application/x-shockwave-flash"][href*="/click"],
embed[type="application/x-shockwave-flash"][href*="promos"],
embed[type="application/x-shockwave-flash"][href*="=click"],
embed[type="application/x-shockwave-flash"][href*="redirect"],
embed[type="application/x-shockwave-flash"][href*="/A="],
embed[type="application/x-shockwave-flash"][name*="advert"],
embed[type="application/x-shockwave-flash"][name*="banner"],
embed[type="application/x-shockwave-flash"][width="728"][height="90"],
embed[type="application/x-shockwave-flash"][width="468"][height="60"],
embed[type="application/x-shockwave-flash"][width="467"][height="63"],
div[id="adstrip"],
div[id*="advert"],
div[id="dropin"],
div[id="dwindow"],
div[id="dcv_EchangeLay"],
div[id="mntl"],
div[id*="popup"],
div[id="quack"],
div[id="splashLayer"],
div[id*="sponsor"],
div[id="yschsec"],
div[class="ovt"],
div#contextualLinks,
div[style="border: 1px solid rgb(221, 221, 221); padding: 5px; background-color: rgb(255, 255, 255);"],
object[id="widgeth"],
*[class="ad"],
*[class*="eSext"],
*[name*="klipad"],
*[style*="/ads/"],
*[id*="popover_"],
*[src*="120x80"],
*[src*="140x"],
*[src*="?ad"],
*[src*="-ad-"],
*[src*="/adimage"],
*[src*="/adimg"],
*[src*="advert"],
*[src*="=click"],
*[src*="banners."],
*[src*="banner_ads"],
*[src*="/images/dinkus/more-arrow-lo.gif"],
*[src*="/javaImages/ec/"],
*[src*="/offer"],
*[src*="/puffboxes/"],
*[src*="/sponsors/"],
*[src*="_sponsor_"],
*[src*="/us.yimg.com/a/ya"],
*[src*=".adbutler.de"],
*[src*=".nedstatbasic.net"],
*[src*=".tradedoubler.com"],
*[src*=".travelocity./Sponsor_gifs/"],
*[src*="a.consumer.net"],
*[src*="bannermania.nom.pl"],
*[src*="cash4banner.com"],
*[src*="crazypopups.com"],
*[src*="hit-now.com"],
*[src*="hitbox.com"],
*[src*="img.thebugs.ws"],
*[src*="kinghost.com/ban/"],
*[src*="klipmart"],
*[src*="popupad.net/ats/"],
*[src*="public"][src*="ad"],
*[src*="/publicidad/"],
*[src*="qkimg.net"],
*[src*="qksrv.net"],
*[src*="rcm-images.amazon.com"],
*[src*="rcm.amazon.com"],
*[src*="salon.com/Creatives"],
*[src*="sexcounter."],
*[src*="sideads/"],
*[src*="statse.webtrendslive.com"],
*[href*="logging.to"],
*[href*="/referral/"],
*[href*="tryaol"],
*[href*="websponsors"],
*[src*="banman.asp"],
*[href*="banman.asp"],
*[src*="bannerman"],
*[href*="bannerman"],
*[src*="?banner"],
*[href*="?banner"],
*[src*="/banner/"],
*[href*="/banner/"],
*[src*="/jump/"],
*[href*="/jump/"],
*[src*="adfarm"],
*[href*="adfarm"],
*[src*="advertising.com"],
*[href*="advertising.com"],
*[src*="ar.atwola.com"],
*[href*="ar.atwola.com"],
*[src*="atdmt.com"],
*[href*="atdmt.com"],
*[src*="bluestreak.com"],
*[href*="bluestreak.com"],
*[src*="clickxchange.com"],
*[href*="clickxchange.com"],
*[src*="doubleclick"],
*[href*="doubleclick"],
*[src*="falkag.net"],
*[href*="falkag.net"],
*[src*="fastclick.com"],
*[href*="fastclick.com"],
*[src*="mediaplex"],
*[href*="mediaplex"],
*[src*="netdirect.nl"],
*[href*="netdirect.nl"],
*[src*="spinbox."],
*[href*="spinbox."],
*[src*="tradedoubler.com"],
*[href*="tradedoubler.com"],
*[src*="transfer.go"],
*[href*="transfer.go"],
*[src*=".tribalfusion"],
*[href*=".tribalfusion"],
*[src*="valueclick"],
*[href*="valueclick"],
*[src*="http://216.92.211.171/"],
*[href*="http://216.92.211.171/"],
*[src*="http://216.92.21.16/"],
*[href*="http://216.92.21.16/"] {
        display: none !important;
}

img[src*=".advance"],
img[src*="/click_"],
img[src*="/cnn/images/clickability/"],
img[src*="/logo2.m"],
img[src$="/banners/com000.jpg"],
a:link[href*=".add"] img,
a:link[href*="admin"] img,
a:link[href*="adobe"] img,
a:link[href*=".adp"] img,
a:link[href*="/advance"] img,
a:link[href*="click.mp3"] img,
a:link[href*="/imgres?imgurl="] img,
a:link[href*=":head"] img,
a:link[href*="http://nettracker."] img,
embed[type="application/x-shockwave-flash"][src*="gallery"] {
        display: inline !important;
} 
Then, go into Safari > Preferences > Advanced and select the Style Sheet from the drop down menu. Now, the majority of ads are blocked in Safari! Be warned though...many sites use GoogleAds or some other service to support their site through users clicking on ads. This defeats that support.

[ Reply to This | # ]
How can I HIDE text ?
Authored by: nael on Jan 22, '06 07:31:49AM

I know this seems *wierd* but i'd like to know how to block or in fact HIDE some words within a website using UserContent.css

I know this is strange, but if you can, please tell me...



[ Reply to This | # ]