homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & martinibuster

Google AdSense Forum

Adsense on blogs on forums

10+ Year Member

Msg#: 4339825 posted 4:49 am on Jul 15, 2011 (gmt 0)

Please correct me if I'm wrong, but I believe it is ok to use Adsense on blogs and forums (whether or not much money can be made is a different issue), but just that you can't put adsense code on pages that are just like login.php, register.php, etc. (just making up possible file names here). Is that right?

I don't want to put ads in the middle of blog posts, etc. I want the site to look cleaner. So I want to puts ads at the top of the pages next to the logo. Which I would do by putting the code in my header.php file. That would cause problems though because then the ads would show up on the types of pages I mention above.

So to work around that problem does anyone know if you can just write some php code that would go something like this :

if not register.php, etc., then show adsense ads?

I'm not sure how exactly to write the php or which files I need to exclude yet, but I wanted to find out if 1)it was acceptable to do this and 2)if it was technically possible. Does anyone know or are doing this already? Thanks!



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4339825 posted 12:35 pm on Jul 15, 2011 (gmt 0)

you could do something like this

if($_SERVER['SCRIPT_NAME'] != '/forum/register.php') {
echo 'adsense code goes here';

i would be a bit worried about putting ads onto forum posts, though -- although lots of people do do it without any problems. because you can never tell when the discussion will descend into something which adsense frowns upon. You mention that they dont like ads on login pages, but they also dont like ads on pages about gambling and stuff like that. What if your users start talking about the bookies? You'll have to police the forum for all the dodgy subjects.


WebmasterWorld Senior Member netmeg us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 4339825 posted 12:46 pm on Jul 15, 2011 (gmt 0)

Yes you can exclude - I don't have a forum, but I do have a bunch of WordPress sites, and I don't run ads on my 404 page, my search results pages, my About page or the page where I sell direct advertising, for example.

But londrum's point is well taken - you never know when one stop word entered by a user might turn your ads off.


10+ Year Member

Msg#: 4339825 posted 5:52 am on Jul 16, 2011 (gmt 0)

Thank you very much for the replies - I really appreciate the help and advice!

When I get the forum started, I plan to moderate the forum pretty heavily, and given topic of the site, I can't see any discussions turning into something google doesn't like.

londrum - so the $_server[''] part is literally part of the code I could use to do it with? That's the one part I really wasn't sure of how to write myself.


10+ Year Member

Msg#: 4339825 posted 2:29 pm on Jul 16, 2011 (gmt 0)

I obviously have no idea what forum or blog software you're running, but on my vBulletin sites (I'm still using the "old" 3.x version) back when I started using AdSense in Jan 2004 I edited the appropriate templates so AdSense would only show up on "content" pages. I wanted to make *very* sure the AdSense folks wouldn't have a complaint. That said, I visit a lot of forums today (not just ones running on vBulletin) which have AdSense showing on every page, even non-content pages. Personally I don't want to take any chances so I keep my forums "clean" (no AdSense on non-content pages).

And while it doesn't (as far as I know) affect AdSense my robots.txt file prohibits indexing of non-content pages such as Register, Attachment, and all the other pages that there is no reason for Google (or any search engine spider for that matter) to spider (why waste their time trying to index non-content pages). E.g.:

Disallow: /Forums/private.php
Disallow: /Forums/profile.php
Disallow: /Forums/register.php
Disallow: /Forums/report.php
Disallow: /Forums/reputation.php
Disallow: /Forums/sendmessage.php
Disallow: /Forums/sendtofriend.php

And yes - You can make money on forums. I cleared over US$100K last year on my main forum alone.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Google / Google AdSense
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved