Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Block an Ad with uBlock Origin

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To block an ad with uBlock Origin, open the extension's popup, click the eyedropper icon (picker mode), then click the ad on the page. The element is now blocked. If the ad is a network request, you can also use the logger to block it permanently. This guide covers both methods, plus how to fine-tune your blocks.

What You'll Need

  • A browser that supports uBlock Origin: Firefox, Chrome, Edge, Opera, or Brave (desktop). On mobile, uBlock Origin works on Firefox for Android; it is not available on Chrome for Android or iOS Safari.
  • The uBlock Origin extension installed from your browser's official add-on store (Firefox Add-ons, Chrome Web Store, Edge Add-ons, etc.).
  • A page that displays the ad you want to block.

Step-by-Step

  1. Open the uBlock Origin popup. Click the uBlock Origin icon (a red shield with a white "u" or a gray shield) in your browser's toolbar. If you don't see it, click the puzzle piece (extensions) icon to find it.
  2. Enter picker mode. In the popup, click the eyedropper icon (the tooltip says "Pick an element"). The popup closes and the page enters a selection mode.
  3. Select the ad. Move your mouse over the ad. A red highlight box will appear around an element. Click on the ad to select it. If the selection is too small or too large, adjust it using the "Preview" feature (see Tips).
  4. Confirm the block. After clicking, a dialog appears with a suggested filter (e.g., example.com##.ad-banner). Click "Create" to add the filter permanently. The ad should disappear immediately.
  5. Test the block. Refresh the page. The ad should not appear. If it still appears, the ad may be loaded from a different domain or use a different selector; try again with a more specific selection.

For network-level blocking (when the ad is a separate request):

  1. Open the logger. Click the uBlock Origin icon, then click the clock-like icon (Logger) at the bottom of the popup. A new tab opens showing all network requests.
  2. Find the ad request. Look for requests to domains that clearly serve ads (e.g., ads.example.com or doubleclick.net). You can filter by typing in the search box.
  3. Block the domain. Click the request line, then click the red "block" button (a circle with a slash) that appears. uBlock Origin will add a filter like ||ads.example.com^ to your custom rules.

Common Mistakes

  • Blocking too broadly: Selecting an element that contains the whole page layout (e.g., the body element) will break the page. Always try to select the smallest element that contains the ad.
  • Using the wrong filter type: The picker creates cosmetic filters (hide elements). If the ad is a separate request, you may need a network filter. Use the logger to block the request directly.
  • Not refreshing after blocking: Some ads are injected dynamically; a refresh ensures the filter is applied.
  • Blocking a domain that hosts legitimate content: If you block a domain like cdn.example.com, you might break images or scripts on the site. Only block domains that are clearly ad-related.

Tips

  • Use preview mode: In picker mode, press Ctrl (Windows/Linux) or Cmd (Mac) while hovering to preview the selection without committing. This helps you see exactly what will be hidden.
  • Create a custom filter list: If you block many ads on a site, consider adding a filter to your "My filters" tab (in the uBlock Origin dashboard) to keep them organized.
  • Use the "Block element" context menu: Right-click an ad and select "Block element" (if available) to quickly enter picker mode.
  • Check the logger for dynamic ads: Some ads change on every page load. Use the logger to block the underlying request domain.
  • Update your filter lists regularly: uBlock Origin updates its default filter lists automatically, but you can manually update them via the dashboard (Settings > Update now).

Troubleshooting

The ad still appears after blocking. First, refresh the page. If it persists, the ad may be loaded from a different domain or use a different selector. Try using the logger to find the request and block it. Also, ensure the filter is not overridden by another extension or a site's own script.

The page layout breaks after blocking. Undo the filter by going to uBlock Origin's dashboard > "My filters" and removing the line you added. Then try a more specific selection (e.g., click on the ad image itself rather than a container div).

uBlock Origin icon is grayed out. This means the extension is disabled on that site (e.g., due to a site's request or because you disabled it). Click the icon and toggle the power button to enable it.

Picker mode doesn't work. Some sites use shadow DOM or iframes that make element selection tricky. Try using the logger to block the request instead. If the picker is completely unresponsive, restart your browser and try again.

Blocked ad reappears after a while. The site may have changed its ad code. Re-block the element or request, and consider reporting the issue to the uBlock Origin community if the filter is not working.

Frequently Asked Questions

Can I block ads on YouTube with uBlock Origin?

Yes, uBlock Origin works on YouTube. Use the picker to block video ads or the logger to block ad requests. However, YouTube may occasionally change its ad delivery; updating filter lists usually fixes it.

Does uBlock Origin block all ads by default?

Yes, uBlock Origin comes with default filter lists (e.g., EasyList) that block most ads automatically. The manual blocking methods described here are for ads that slip through.

Will blocking an ad break the website?

Sometimes, if you block a script or element that the site relies on for layout or functionality. Always preview your selection and start with the smallest element. If something breaks, remove the filter.

Can I undo a block?

Yes. Go to uBlock Origin's dashboard > "My filters" and delete the line you added. The ad will return after refreshing the page.

Does uBlock Origin work on mobile browsers?

uBlock Origin is available for Firefox on Android. It is not available for Chrome on Android or iOS Safari. On iOS, you can use Safari's content blocker feature with other ad blockers.

Is uBlock Origin safe to use?

Yes, uBlock Origin is open-source and widely trusted. It does not collect user data. Always download it from official browser stores to avoid fake versions.