# Exclude topic from AdSense

**URL:** <https://meta.discourse.org/t/exclude-topic-from-adsense/95281>\
**Category:** Product Support\
**Created:** [8월 21, 2018, 12:08오후 UTC](https://meta.discourse.org/t/exclude-topic-from-adsense/95281 "2018-08-21T12:08:37Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [8월 22, 2018, 5:33오후 UTC](https://meta.discourse.org/t/exclude-topic-from-adsense/95281/6 "2018-08-22T17:33:20Z")

</div>

> [@omarfilip](#):
>
> If you serve AdSense ads through Google Ad Manager (formerly DFP), perhaps you could do something like this:

I’m using plain old AdSense, so I’m afraid that won’t work.

> [@Mittineague](#):
>
> Maybe you could limit such “specific pages” to a category requiring being in the TL0 group?  
> Search engines do not register accounts and belong only to the everyone group.

Hmmm, but that would take the topics out of the context of their current category. I don’t think that’s a good idea either.

So far, I’ve tried writing some CSS rules that use the `[data-topic-id="12345"]` selector to target the adsense blocks on that page and set them to `display:none`, but that selector doesn’t get used until the posts stream. Since I also have an ad at the very top of the page, I can’t target it.

So perhaps I can write some Javascript to just compare the current topic ID to a defined list and use jQuery to insert some styling ad needed.

The question is now: how can I access the topic ID from Javascript, in a way that doesn’t require any additional server requests?

---

_[View the full topic](https://meta.discourse.org/t/exclude-topic-from-adsense/95281)._
