How to Hide Unwanted Google Search Ads Using Custom Adblock Plus Filters

This guide walks through identifying intrusive Google search elements—such as related YouTube videos and product promos—and shows how to create Adblock Plus custom filters that hide those elements by targeting their CSS classes or IDs, complete with code examples and screenshots.

FunTester
FunTester
FunTester
How to Hide Unwanted Google Search Ads Using Custom Adblock Plus Filters

When performing a Google search, related YouTube videos and Google product results often appear alongside the desired results, making the page look cluttered after script optimization. By consulting the Adblock Plus custom filter documentation, a practical solution can be implemented.

Google search results before filtering
Google search results before filtering

The page structure reveals that the unwanted elements are wrapped in containers such as div with class="textad" and div with id="sponsorad". Hiding the element with id="acid_src" also removes a related ad.

HTML structure of the search result page
HTML structure of the search result page

Based on this observation, the following filter rules can be added to Adblock Plus:

<div class="textad">Cheapest tofu, only here and now!</div>
<div id="sponsorad">Really cheap tofu, click here!</div>
<textad>Only here you get the best tofu!</textad>

These examples illustrate three different ad containers. The corresponding filter syntax is: ##.textad – hides any element with the class textad. ###sponsorad – hides the element whose id is sponsorad. ##textad – hides any element named textad regardless of its attributes.

By adding these rules to the Adblock Plus custom filter list, the unwanted ads disappear from the Google search results page.

Google search results after applying filters
Google search results after applying filters

The author invites readers to discuss the approach further and welcomes feedback.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

frontendCustom Filtercss selectoradblockgoogle search
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.