Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How to hide Adsense ads from certain pages?

Hide AdSense from Some pages

1:11 am on Oct 7, 2007 (gmt 0)

New User

10+ Year Member

joined:Oct 7, 2006
posts: 21
votes: 0


how can i remove the adsense ads from some pages, such as the TOS, or pages with no content?

i think we are not allowed to put the ads on pages without content, such as the TOS. am i right?


11:42 am on Oct 7, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2005
votes: 0

Just remove the adsense code on those pages.
2:44 pm on Oct 7, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 6, 2005
votes: 0

Maybe not the best solution, but...

I have used an array containing URLs that should not show AdSense ads and then checked the current URL against this list.

5:32 am on Oct 8, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
votes: 0

In addition to barns101, if it is a dynamic site, you might be passing parameters over to pages to get the correct display. I am not sure what you are passing on your pages, but based on those parameters you might be able to isolate the ones which you don't need adsense to display. Or if they are many in number, or just works fine this way, you can have one more passing for your adsense purposes alone like the following:


ad=1 being the adsense displaying, ad=0 being not displaying.

If you don't want to expose it that way, you can hide it as well in SESSION or cookies.

I hope this gives you some idea on how to accomplish this.