• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Ad Placement Problem

Is there a way to have ads show on a forum EXCEPT for when thread content is displayed? This is necessary for me because people can post words/information that violate Google's policies.

Selling firearms is a prime example... I don't allow people to sell firearms on my site, but I can't stop someone from posting a gun for sale. Google catches that and good bye adsense account!



XenForo moderator
Staff member
You can use a conditional statement to prevent ads being displayed on certain pages.

There are guides for that and AdSense in my signature.
Hey Brogan, I'm trying to follow your instructions and am looking for what template to have not show ads. The only place I don't want to show ads is when a thread is opened and member generated content is visible.

Any ideas??

I plan on using this
<xen:if is="{$contentTemplate} != 'xyz'">
This content will not show on the xyz template ???

Let me know if im on the right track. Thanks

Mr Lucky

Well-known member
Template = thread_view I think.

However you will lose revenue like this, and I really doubt you would have a problem with Google - it's very common for adsense to be visible especially when threads are being viewed.

I've been displaying Adsense for years threads, nobody has ever made a comment that would be against Google T & C.

Also note that any forums that are only viewable when logged in, Google will never see. Unless it joins your forum :)