Remove Text Ads from GMail

by Tom Mullaly on October 12, 2004

Do you find the text ads in GMail to be annoying? If you do, you can use Firefox to hide the ads from displaying.

This trick uses CSS and the Firefox configuration file named userContent.css . Before we start modifying our userContent.css file, I would recommend that you install an extension named ChromeEdit that simplifies the process of modifying your Firefox configuration files. So before you enter the CSS code listed below, go and install this extension (note: you’ll need to restart your browser after installation, so you may want to bookmark this page).

Now that you have CromeEdit installed, click on the Firefox Tools menu and then click on the menu item labeled Edit User Files. A new window will appear that has five tabs across the top. Click on the tab that is labeled userContent.css. Next copy the CSS code below and paste it into the userContent.css file, then click the Save button.

#rh table[class=”metatable”]{display: none !important;}
#rh div[class=”c”] {display: none !important;}

Now, restart your browser and open GMail – the ads are gone!

The above rules make use of the *!important* property value to override any rules that may already exist within the page that is being loaded. In the first rule, GMail has an element with an id of rh and we are setting the tables that have a class equal to metatable within that element, to not display (ie . display:none)

A word of caution, we are only hiding the ads from displaying. They are actually still there, just not visible. This means that Google is still indexing your email messages to provide you with “targetted ads”. It is also worth noting that as this hack is based upon creating CSS rules for existing GMail code, it is very possible that this hack will break as GMail continues to evolve.

Be Sociable, Share!

{ 24 comments… read them below or add one }

Bill Rawlinson

funny, i never even really notice the google adds.. plus, I figure I can at least let them show up since they are giving me a gig of free space.

how annoying can they really be?

Plus, what happens if google classes something else with the table.metatable – something you need to see?

While it is always cool to see folks digging into the guts of things – I don’t know that hiding one thing today is safe for tomorrow.

Jim Rutherford

Good points Bill. Even though I can turn off the ads in GMail, I have chosen to display them. I often find some really useful links/products from the text ads.

I figured I would post the information, as I have seen alot of people posting about how they don’t like them.

Gary King

Unless I see the ad-space used then I don’t see much point for this.

I, too, do not notice the ads and don’t mind them being there, unless I can actually remove them in order to use that space to expand my email viewing area.

logi

I don’t like the ads, because they’re ads, and I don’t like ads in anything. But I can’t get this to work at all, do I just paste it at the end of the file or what?

Soletix

Isn’t

#rh table.metatable {display: none !important;}

the same like the above?

Sandro

It’s easyer to remove the ad-Iframe via Firefox-Adblock extension…

Robert D.

To be honest, Gmail’s text ads don’t bother me at all. They’re subtle, which is a heck of a lot more than I can say for Hotmail’s garish banners and pop-ups.

Not shilling for Google.

Unlike some of the posts above, I’m afraid I find the text ads quite distracting and generally unpleasant to have to put up with.

Any extraneous information presented on a page that has the sole purpose of directing the user away from that page – whether it is a bright-pink banner, a full page flash eyeblaster, or a little box of text – has to distract the user from what they are doing in order to be effective.

If the advertisements were not distracting, nobody would clock on them. They simply wouldn’t work.

If they didn’t work there is no way google would still be pushing them.

Google and the other purveyors of text ads seem to think that if they tell enough people that the ads are unobtrusive then sooner or later people will start believing it.

Maybe it will work. People tend to be idiots.

papuass

Good news for not so populat languages: WhenI write in Latvian I get ZERO text ads. Google just can’t understand my texts :)

raam

great informations here. thank u!

me

You know… The adds don’t bother me during regular emails. But I do business on eBay, and for some reason their emails don’t wrap with gmail. The ad sits right over the message, and I have to copy paste the message to read it. So, I will try this out as soon as I can get back into my gmail account – server errors won’t let me in!!!

Metar Heller-Algazi

Hey phuakh, Gmail has expanded their invitations, now almost every Gmail user has 50 invitations to spend… send me an E-mail, and i’ll give u an invite…

ultramancool

i hate ads and alread killed them with RIP and all other with adblock

eVox777

it doesn’t work. :(

LordSturm

Sure it works!! Just make sure you correct the mistakes the editor makes when you copy and paste the code in, when i was testing how the ads were removed i didnt notice any difference so i removed the code only to take 2 mins to find any ads, i think they shouldn’t be hidden but im going to see if it hides all google ads alltogether!!!
FireFox will rule the galaxy…
Damn IE…

Diskdr

The adds are sometimes annoying, if someone emails me with a computer problem and I email a quote for a job sometimes they are give relative adds for other computer repair services. The real problem here is how they scan your mail for keywords relavent to your particular email. I don’t buy into all that gmailistoocreepy.com stuff but its just something to think about. If your using it for business they are advertising your competition. The price you pay for almost 3 gigs I guess.

miztiik

does this work only in firefox

kenfun

I enjoyed the site (seriously ) and I understand that perhaps at the moment self promotion is bad and may seem superficial, but nevertheless I cannot resist the temptation of inviting you over to my site to take a look at one thingie and to say what you think . Thanks in advance.

ShakaZ

Hello,

i was about to apply this solution to remove those adds, but as the article suggests it will probably work for a limited time only and i’m not sure if this hack won’t prevent useful information from displaying on other websites.

So i tried removing it with the RIP extension (Remove It Permanently) and it works fine… if you right-click at the right place you can remove the whole frame in one easy step (choose the ‘remove from this webpage’ option so you don’t have to worry about it any more)
This method seems more adequate to me as it will be much easier to revert or modify should google change their ads-code

dep

You can also download the firefox extension Stylish and then create a gmail rule with the following code:

@-moz-document url-prefix(http://mail.google.com/) {
#rh, #rh .c
{
display:none!important;
}
}

Pepe

The last one works, but also get rid of the “Print” “Show all” “Show none” “Forward all” options, I think that they are more useful than the level of annoyance of the ads
Sorry because of my bad English.

alex

hi nice site.

Tim

Hi, nice. I just thought of this too, but for me the following was sufficent:

install AdBlock Plus
define two rules:
google.com#div(id=ra)
google.com#div(class=rhh)

or in a stylesheet:
div#ra, div.rhh {
display: none!important;
}

nm

here’s how i do it… create a signature with the word death or dead in it – which block ads.. then make the font of the text white on white. no ads will show in messages.

Leave a Comment

Previous post:

Next post: