The easiest way to block a pesky website is to use the Parental Controls and adding the site a list, but that only works for the obvious websites like Playboy.com etc.
More likely we’re browsing the web, possibly a favorite website with news and media. Often there’s a section of content imported in from another obscured source that displays our latest shopping interests; this is called “targeted marketing” and serves a legitimate purpose. However many times it’s compromised with annoying images and text, typically misleading headlines to fake news, solutions to crude physical ailments, low-brow images, and worse.
For good or bad, these websites are known to share your browsing activity: Amazon, eBay, Alibaba, Auto/Motorcycle/RV Parts, News/Weather/Jobs/Food Portals, “free” Medical websites; anyplace you visit for shopping of any sort, you name it - most do it. Thankfully Government and Utility sites DO NOT share.
The easiest way to avoid having your browsing experience exploited is to execute the Browser in Privacy (Anonymous) Mode, but we all know that is a PITA.
A better way is to just Block the Content, and to do that we have to get the name of the serving Host. Modern browsers like Chrome and Internet Explorer have Developer Tools which helps quite a bit. I’m not going to explain how to uses these other than to highlight the section of pesky content, locate the source code, and search for the root host addresses of the content, such as IMG SRC or Background-Image URL. Once located, we can usually test the validity of the source by hacking it in situ without wasting a lot of time.
Next, we modify the O/S HOSTS File that contains a list of Addresses that are redirected to the Local IP Address which in effect blocks the resource. See Wikipedia: hosts (file)
- To begin, close all open browsers and applications that use browsers for Help.
- Open a new Browser instance, clear out the Cache, then close it.
- Purge Temporary files.
- Make a HOSTS File Backup: Presuming that Windows is installed on the C-Drive, navigate to “C:\Windows\System32\drivers\etc”, select the “hosts” file (it will not have an extension), then Copy|Paste to create the backup.
- With Notepad running as Administrator,
- File Open, change filter to “All Files (*.*)”
- Navigate to “C:\Windows\System32\drivers\etc”
- Select the “hosts” file, and click Open button.
- The syntax of the Hosts file is:
- IP Address, given as “127.0.0.1” which points to the Local Machine Server.
- Name Resolution, given as “localhost” or “rhino.acme.com” or “x.acme.com”, etc.
- Create a new entry of the site that you want to block, for example “ad.doubleclick.net”:
- Literally, format the new entry as “127.0.0.1 ad.doubleclick.net” without quotes.
- Save the File. If you don’t have Admin Rights, then Windows will not allow the file to be saved.
- Reboot. Before Windows 10, we didn’t need to reboot, but now this is the only sure-fired way.
- Test by returning to the website that had the pesky content and refresh: If we did our homework the content should not appear. Success comes through trial and error, and persistence pays.
Here is a link to someone that has maintained a current list. I have developed my own though years and years. If it were me, I would only add the names that really cause frustration, otherwise there is risk that important content may become blocked, like throwing out the baby with the bathwater. Let common sense prevail.