# Hoe voorkom je dat de Ads Plugin advertenties weergeeft op de forumhomepage

**URL:** https://meta.discourse.org/t/how-to-prevent-ads-plugin-from-displaying-ads-on-the-forum-homepage/356799
**Category:** Support
**Tags:** advertising
**Created:** [11 maart 2025 om 14:56 UTC](https://meta.discourse.org/t/how-to-prevent-ads-plugin-from-displaying-ads-on-the-forum-homepage/356799 "2025-03-11T14:56:51Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [14 maart 2025 om 16:07 UTC](https://meta.discourse.org/t/how-to-prevent-ads-plugin-from-displaying-ads-on-the-forum-homepage/356799/9 "2025-03-14T16:07:21Z")

</div>

> [@Jacob\_Peebles](#):
>
> is there any CSS trick to suppress the ads on the homepage/root page only? We’d be willing to risk that - it’s better than having a terrible user experience from the first impression.

Here is some JS that _removes_ the ad HTML from the homepage (not _hidden_ with CSS).  
Let me know if it works for you.

You can put it in your theme JS tab:

```js
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  api.onPageChange((path) => {
    if (path === "/") {
      document.querySelector(".adsense-topic-list-top")?.remove();
    }
  })
});

```

 ![The image shows a code snippet in a code editor for an Ember.js application, focused on JavaScript code with logic for handling page changes and template management. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/0/3/9/03918e78be679b7831e0333896312ae9a3033eca.png)

---

_[View the full topic](https://meta.discourse.org/t/how-to-prevent-ads-plugin-from-displaying-ads-on-the-forum-homepage/356799)._
