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

XF 1.4 Preventing Ads on a Per Thread Basis


Well-known member
I'm about to implement adsense again on my site, but there are a few odd threads they may be against the TOS of adsense, well not really but I know how google can be so sensitive about it so would rather play it safe,

My idea is to wrap the ad tags in this statement

<xen:if is="!in_array({$thread.thread_id}, array(x, y, z))">
This content will show in threads x, y, and z
that way I can filter individual threads that I think are a bit gray.

Firstly is this going to cause problems performance wise? and also is there a way to maintain a center list of the thread numbers then I can just update them the once so all the different places I'd place the ad code.


XenForo moderator
Staff member
It shouldn't cause any performance issues.

Create a custom template and add the xen:if to it.
Then include the template in the ad templates.