Forum Moderators: coopster

Message Too Old, No Replies

How to hide Adsense ads from certain pages?

Hide AdSense from Some pages

         

hisoc8y

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

10+ Year Member



hi

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?

thanks

Gian04

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

10+ Year Member



Just remove the adsense code on those pages.

barns101

2:44 pm on Oct 7, 2007 (gmt 0)

10+ Year Member



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.

Habtom

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

WebmasterWorld Senior Member 10+ Year Member



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:

www.example.com/index.php?ad=1

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.