How Ad Blockers Work
See how ad blockers use filter lists to stop requests and hide page elements, where each blocking method works, and why some ads still get through.
Key takeaways
- Most blocking happens at the network level, where a request to a listed address is cancelled before anything downloads.
- Cosmetic rules hide leftover page elements, and small injected scripts can neutralize code that rules alone can't handle.
- Browser extensions, built-in browser features, DNS filtering and network devices block at different points, each with blind spots.
- A blocker has deep access to your browsing, so its developer and update source matter as much as its features.
An ad blocker compares what a web page is trying to load and display against long lists of rules. When a request matches a rule, the blocker stops it before it leaves your browser. When an unwanted box is part of the page itself, the blocker hides or removes it. Everything else in the product, including the counters and settings, sits on top of those two moves.
Knowing the mechanism helps you predict what a blocker can catch, why a site sometimes breaks and what you give up by trusting one.
What happens when a page loads
A web page is assembled from many requests. Your browser fetches the HTML, which then asks for stylesheets, images, scripts, fonts and frames, often from other companies. Advertising usually arrives through scripts that call an ad network, which runs an auction and returns a creative to display. Tracking scripts travel the same way.
A blocker watches that stream of requests. If the address, resource type and context match a blocking rule, the request never happens. Nothing downloads, so you save data, and the third party learns nothing from that request.
Filter lists, the heart of the system
Rules come from filter lists maintained by volunteers and organizations. Widely used examples include EasyList for advertising and EasyPrivacy for tracking, along with regional and specialist lists. Your blocker downloads updates regularly, because ad servers and page layouts change constantly.
Many blockers share a rule syntax that looks cryptic but is readable once you see a few patterns:
||ads.example.com^
||example.com/banners/$image
@@||example.com/player.js$script
example.org##.sponsored-box
! a line starting with an exclamation mark is a comment The first rule blocks requests to a hostname and its subdomains. The second blocks only images from a path. The third, beginning with @@, is an exception that allows a script. The fourth hides any element with the class sponsored-box on one site. Exact syntax and supported options differ between blockers.
Three techniques working together
Network blocking cancels requests, as described above. It is efficient and covers most advertising and tracking from third parties.
Cosmetic filtering deals with what is already in the page. If an ad is written into the HTML, or a blocked request leaves a gray box, the blocker applies CSS selectors to hide it. The data may still have downloaded; you just don't see it.
Script injection handles stubborn cases. The blocker runs a small, prewritten snippet in the page that, for instance, stops a pop-up from opening or defines a harmless stand-in for a missing ad library so the site doesn't crash.
Extensions, built-ins, DNS and routers compared
An extension sees full addresses and page content, so it can do all three techniques. It covers only the browser where it is installed.
A built-in blocker or tracking protection is part of the browser. Some browsers block ads by default; others focus on known trackers. Chrome has included limited filtering aimed at ads that violate certain intrusiveness standards, which is much narrower than a general blocker.
DNS filtering works when your device looks up a domain name. A resolver that recognizes an ad domain returns no usable address. It covers apps and smart devices that you can't extend, but it only sees domain names. It can't block an ad served from the same hostname as the content, and it can't hide empty boxes. See how DNS filtering works for homes and offices and how encrypted DNS can route around your network's resolver.
Router or home server blocking applies the DNS idea to everything on your network. It stops working when a phone leaves home unless you route its traffic back.
Combining a DNS filter with a browser blocker is common: broad coverage from one, precision from the other.
Why some ads get through
Blockers rely on being able to tell advertising from content. That gets harder when:
- Ads come from the site's own domain, with addresses that look like ordinary files.
- Ads are stitched into a video stream on the server before it reaches you.
- Class names and addresses are randomized on every load.
- The "ad" is sponsored text written into an article or a creator reading a sponsorship aloud.
Sites also detect blockers, usually by checking whether a bait element was hidden or a script failed to load, and then show a request to allow ads or subscribe. Rule writers respond, sites adjust and the cycle continues. Terms of service for some sites prohibit blocking, and you can choose to allow ads, pay or leave.
What blockers do for privacy and security
Cancelling tracker requests reduces the number of companies that see your visits. Blocking ad networks also lowers exposure to malicious ads that lead to scams or harmful downloads. Pages often load faster and use less data.
The protection has limits. A blocker doesn't hide your IP address from the sites you do visit, doesn't encrypt anything and doesn't stop first-party tracking tied to your account. It is one layer alongside the practices in how websites track you and defenses against fingerprinting.
Acting on trackers, not just ads
Many of the rules in privacy lists have nothing to do with anything visible. They cancel analytics beacons, social media widgets that report your visit before you click them, and tiny invisible images used to count views. A page can look identical with and without those rules while sending far fewer reports to outside companies.
Some blockers and browsers also strip tracking parameters from addresses, the long tags added to links so a click can be attributed to a campaign. You can inspect them yourself with a query parameter editor. Others partition or block third-party cookies, which is a storage control rather than request filtering and works alongside it.
Replacing a blocked script with a harmless stand-in matters here. Some sites call functions from an analytics library inside their own buttons. If the library never arrives, the button fails. A stand-in that accepts the call and does nothing keeps the page working while reporting nothing.
Read the blocker's counter carefully
The number on the icon is the count of requests or elements the blocker acted on. A large figure doesn't mean the page was dangerous, and blockers count differently, so comparing the numbers of two products tells you little. A script that retries a failed request several times can inflate it.
The logger or details panel is more useful than the total. It shows which hostnames the page tried to reach and which rule matched each one. That is how you find the single entry breaking a login form, and it is an eye-opening way to see how many outside services an ordinary page calls.
Choose and configure one responsibly
A blocker can read the pages you visit, so apply the same scrutiny as for any powerful extension. Pick a well-established project with a visible developer, install it from an official store through the developer's own link, and watch for imitators with similar names.
Check the business model. Some blockers allow certain ads by default under an acceptability program, sometimes involving payment, and let you turn that off. Read the settings so you know what you have.
Run one general content blocker. Two or three overlapping ones waste memory and make breakage harder to diagnose. Don't enable every available list; each adds rules and the chance of false positives. The capabilities of Chromium extensions also changed with Manifest V3, so features differ between browsers.
Fix a site the blocker broke
If a button does nothing or a checkout stalls:
- Pause the blocker for that site and reload.
- If that fixes it, turn blocking back on and use the logger, if your blocker has one, to see what was cancelled.
- Add a narrow exception, or leave the site on your allow list if you trust it.
- Report the breakage to the list maintainers so everyone benefits.
If pausing changes nothing, look elsewhere, starting with other reasons pages look broken.
The money question
Many sites are paid for by advertising. Supporters of blocking point to privacy, security, accessibility and control over their own devices. Publishers point to lost revenue that funds writing, video and free services. You can act on both concerns by allowing ads on sites you value, subscribing where it's offered, or blocking only tracking while permitting ads that don't follow you around.
If you publish a site, look at measurement that respects visitors, and expect that some share of your audience runs a blocker. Make sure core functions such as navigation and checkout still work when third-party scripts fail to load.