Block Unwanted Content Using uBlock Origin

Programming Knight
3 min readOct 28, 2021

--

uBlock Origin

The advertisements we see on the internet every day can be a real pain. There are ads that are linked to malware, which is known as malvertising. The ads are the obstacle which prevents you from accessing the information you wish to access, without difficulty. Additionally, these ads are downloaded on your device which increases the amount of data you use per day, which can cause problems when you have the data plan with a limit.

The answer to all of the problems mentioned above is an ad blocker. Ad-blockers can be added to the browser in order to block advertisements, and they use the community-generated filter lists and block ads.

Since these lists of filters aren’t 100% accurate, you may see an ad every once in the time. However, ad blockers like UBlock Origin can allow you to block ads manually when they show up.

uBlock Origin

UBlock Origin is an ad-blocker which is completely free and accessible across all major browsers. There is also an element selector within this program that can remove the custom elements.

If you are familiar with the basics about CSS or Xpath It can be beneficial to you during the course of this guide However, it’s not mandatory.

uBlock Origin will provide you with the tools for visual analysis that you can utilize to choose elements with no technical understanding.

What Are The Uses Of Blocking Elements

There are many situations when the information we consume on the internet simply isn’t pertinent.

If you have a handful of websites you browse random, removing information that you don’t require can be an enormous boost in your productivity

  • Certain kinds of events can be excluded from the activity or feeds of social media.
  • The pop-ups that insist on doing things you do not want to be doing can be eliminated.
  • Certain content made on YouTube as well as other media sites by particular authors are taken down
  • Dynamic elements that could distract you can be removed.

Filtering HTML Elements

Click to the uBlock Origin icon at the top of your web browser and select the element selection tool using an eyedrop icon to select elements.

If you click on the icon in your browser’s toolbar, an uBlock Origin interface will appear. After that, you’ll be able to select the information you’d like to get rid of. Even if you’re not able to select the content the right content, it’s an initial point.

It is possible to use the visual tools by pressing an “Pick” button and sliders when the box appears at the lower left of the screen or you can use a manual method to specify an option.

After you click”Create” and click the “Create” button, the content marked in red is deleted. If you return to the page later time or simply go back to the site, the modifications will be in effect. Let’s see how this happens.

CSS Selectors

A majority of the elements you would like to get rid of are removed by using CSS selectors with ease. Particularly the static content of the page.

XPath

XPath is mostly used to fulfill one of two reasons:

  • If you need to verify against the worth that an element has.
  • In the event that an element must be chosen based on the attributes of its siblings.

It’s most useful for getting rid of user-generated or dynamic content.

Removing Filters

It is possible that you will need to visit the website at some point, or the website has changed in both instances you’ll need to take off the previous filter.

To get rid of the filter that you have created:

First step Step 1: To begin, visit the settings for uBlock Origin.

Step 2. 2. Select”My filters” tab “My filters” tab.

Step 3. 3. Delete those lines that have the filter(s) you’d like to remove.

step 4 4. Click on “Apply changes” at the top.

5. Refresh the page.

--

--