The following guide explains in simple terms how to remove any element on any web page permanently using the browser extension uBlock Origin.
Ublock Origin is a content blocker that works really well out of the box. It supports lists that you can subscribe to, to improve the blocking of certain types of annoyances on the Internet (e.g. social media plugins, malware domains, trackers), options to whitelist sites to support them or make them work, a custom filter list, and an element picker that you may use to remove elements permanently from pages.
While uBlock Origin works well out of the box, you will get the most out of the extension if you know about the features that it offers besides that.
This article looks at the extension’s Element Picker feature. It can be used to hide elements permanently on pages that the default set of rules do not block.
Side note: Most browsers enable you to block page elements temporarily.
Note that uBlock Origin is available for several web browsers including Firefox and Chrome. To the best of my knowledge, all support the Element Picker functionality.
Blocking elements on web pages permanently using uBlock Origin
The first thing that you need is uBlock Origin (doh). Visit the extension’s GitHub page, and either download the extension from it directly, or follow the links on the main page instead to the add-on repositories for Firefox and Chrome.
You may use the feature of uBlock Origin to hide YouTube comments, recommendations, suggestions, or any other element on a page that you don’t need, find distracting, or find annoying.
Hiding elements on pages permanently using uBlock is a two-step process.
Step 1: Selecting the element that you want to block
You have two options to invoke the blocking functionality of uBlock Origin. You may either right-click on any element in the browser and select the “block element” option from the context menu.
Once you select the option, the element right underneath the mouse cursor is highlighted in red, while the remainder of the page is darkened.
You may adjust the selection by moving the mouse cursor and clicking once elsewhere. This enables element picking mode which highlights the element the mouse is on at any point in time.
So, if the action did not pick the right element right away, you need to click once, and move the mouse around until it gets it right.
Click again to lock the selection. The extension’s element picker mode uses two different icons that indicate its status.
The stop button indicates that an element has been locked. You will notice that elements are not selected anymore when you move the mouse. The selection icon on the other hand is easy enough to spot as it selects elements the mouse cursor hovers over.
Step 2: adding the new rule
Now that you have made a selection, it is time to add the rule to uBlock Origin so that the selected element is removed from the page.
This step can be a bit confusing, as there is no real indication what to do at this point. You need to move the mouse cursor to the lower right of the browser window once you have locked an item to reveal the semi-transparent rule creator.
Take a look at the screenshot above to see where it is located on a page.
A click on preview removes the selected element temporarily so that you see how the page looks like without it.
Click create to add the rule to uBlock Origin. If you do that, the selected element is removed from the page. It stays hidden even if you reload the page.
Note: some sites use dynamic identifiers for some elements on their sites. This may result in you blocking the element on one page, but not on any other page of the site. The only option you have in this case is to find a common denominator and block that instead. It is usually best to use the built-in developer tools for that to go through the page source.
Removing filters again
Now that you have set some filters, you may at one point in time want to remove filters again. You do that by right-clicking on the uBlock Origin icon in the browser and selecting the options link.
Switch to “my filters on the page that opens. There you find listed all custom filters that you have added earlier or imported.
You need to remove all lines of a filter. This is rather easy to do as filters are always separated by a space, so that you know where filters begin and end.
Select apply changes afterwards to save the selection again.
Closing Words
The browser extension uBlock Origin makes it super easy to block content on web pages you visit. All it takes is a couple of clicks, and sometimes some manual adjusting, to block elements permanently.
Now you: do you use custom blocking rules for sites?