How ad blocking works


One of the main functions of Adguard is filtering ads on websites. In this article, we will describe in details how exactly Adguard filters online advertising.

Adguard's work is based on the use of various advertising filters that define rules, based on which the program removes ads. Adguard may use a variety of different ad filters. We create some of them ourselves (you can learn more about it on this page), some of the filters are created by enthusiasts.

Ad filtering

Ad filtering mechanism depends on what product you use. Browser extensions rely on the capabilities that browsers provide them with. Adguard for Windows, Mac and Android works independently of your browser, using a completely different filtering algorithm. Below we describe all the stages of ad filtering that Adguard uses.

Page code filtering

Before a page is loaded into browser, Adguard processes its code removing elements according to the ad filtering rules. Thus browser does not recognize that there were actually those elements on this page and will not try to load them.

Adguard: Page code filtering

Page code filtering technology is used only in Adguard for Windows, Mac or Android (if high quality filtering is enabled). That is because of the fact that capabilities of browser extensions are limited, and they can not change the page code before the browser processed it.

Request blocking

Browser loads all the necessary elements on a page, defined by the page code. Based on filtering rules, Adguard can block the load of advertising elements, such as banners ads or Flash objects.

Adguard: Blocking of queries

CSS Injection and Javascript

Not all advertising can be blocked within the first two steps. For instance, there is such a kind of advertising that is embedded in the page dynamically with the help of Javascript, and does not require loading of additional items that we could block.

CSS is a special language used for web pages design. Display style of elements on a web page can be set by rules. By style we mean color, font, location, and even the visibility of the element. And that is of interest to us, because we want to hide the banner from you. Javascript is also a special language that allows you to dynamically change any element on the page.

Post-processing of pages

This is an approach for browser extensions only. It is necessary, because the first step of processing (page code filtering) is unavailable to them. During post-processing, the browser extension removes all the elements, loading of which was blocked, from a web page. If we didn't remove them, you would see not fully loaded elements, such as "broken" graphic.

Do you want to help?

All ad filters are created manually, based on complaints on ads from users. You can send us a complaint via the program itself or write about it on our Forum.

Operating System:
Adguard for Android provides you with a reliable and manageable protection. Adguard removes all the annoying ads from web pages and applications, blocks loading of dangerous websites, and will not allow anyone to track your activities on the Internet. Adguard stands out against its analogues as it can work both in HTTP proxy and VPN mode.
Download Adguard Product Page
Operating Systems Android 4.0.3 +
RAM from 700mb
Free Disk Space 30mb
Adguard for Mac is the first adblocker developed specifically for OS X. Not only it blocks ads and annoying popups in any browser, but also protects you from online trackers and dangerous websites. Adguard offers you simple and intuitive interface with such additional features like Adguard Assistant and filtering log.
Download Adguard Product Page
Operating Systems OS X 10.7 (64 bit) +
RAM from 2Gb
Web Browsers Safari, Google Chrome, Opera, Yandex browser, Mozilla Firefox and other
Free Disk Space 60mb
Adguard for Windows provides you with a reliable and manageable protection that immediately and without your participation filters loading web pages. Adguard removes all the annoying ads and popups, blocks dangerous websites, and does not allow anyone to track your activities on the Internet.
Download Adguard Product Page
Operating Systems Windows XP SP3, Vista, 7, 8, 8.1, 10
RAM from 512mb
Web Browsers Microsoft Edge, Internet Explorer, Google Chrome, Opera, Yandex Browser, Mozilla Firefox and other
Free Disk Space 50mb
Adguard for iOS is an app that protects you from annoying ads in Safari. Moreover, it prohibits online tracking and secure privacy of your personal data. After downloading the app, you get the ad-free and safe Internet, where websites open much faster. Try now and enjoy web surfing experience on your iPhones and iPads.
Download Adguard Product Page
Compatibility Requires iOS 9.0 or later. Compatible with iPhone 5s, iPhone 6, iPhone 6 Plus, iPhone 6s, iPhone 6s Plus, iPad Air, iPad Air Wi-Fi + Cellular, iPad mini 2, iPad mini 2 Wi-Fi + Cellular, iPad Air 2, iPad Air 2 Wi-Fi + Cellular, iPad mini 3, iPad mini 3 Wi-Fi + Cellular, iPad mini 4, iPad mini 4 Wi-Fi + Cellular, iPad Pro, iPad Pro Wi-Fi + Cellular, and iPod touch (6th generation).
Web Browsers Safari
Free Disk Space 24.4 MB