Back to Blog
Guide9 min read

Element Blocking Without Ad Blocking: Is It Possible?

Exploring the possibility of blocking specific website elements without enabling comprehensive ad blocking, and how it impacts privacy and performance.

T

The AdBlock Mobile Team

December 13, 2025

I recently came across a discussion about blocking specific elements on websites without enabling full-fledged ad blocking. It's a fascinating idea that highlights a common frustration: sometimes, we just want to declutter a page, not necessarily eliminate all ads.

This got me thinking about the various approaches to element blocking and whether it’s truly possible to achieve granular control without affecting ad display. Let’s delve into this and explore the implications for mobile browsing.

The Need for Selective Blocking

Many websites are cluttered with elements that aren't necessarily ads but still detract from the user experience. These could include:

  • Social media widgets (e.g., Facebook Like buttons)
  • Annoying cookie consent pop-ups
  • Newsletter signup forms
  • Related articles sections
  • Comment sections

While ad blockers effectively remove ads, they often lack the precision to target these specific elements without also blocking legitimate advertising. This is where the concept of selective element blocking becomes appealing.

Understanding Element Blocking

Element blocking involves identifying and hiding specific HTML elements on a webpage. This can be achieved through various methods:

1. CSS Selectors

CSS (Cascading Style Sheets) is the language used to style web pages. Element blockers often use CSS selectors to target specific elements based on their class, ID, or other attributes. By applying a display: none; style to these elements, they can be hidden from view.

Example: To hide all elements with the class annoying-widget, you could use the following CSS rule:

.annoying-widget {
  display: none !important; /* !important ensures it overrides other styles */
}

2. JavaScript Injection

JavaScript can be used to dynamically modify the DOM (Document Object Model) of a webpage. Element blockers can inject JavaScript code to identify and remove specific elements. This approach offers more flexibility than CSS selectors but can also be more complex to implement.

Example: To remove an element with the ID cookie-banner, you could use the following JavaScript code:

const banner = document.getElementById('cookie-banner');
if (banner) {
  banner.remove();
}

3. Browser Extensions

Browser extensions provide a convenient way to inject CSS or JavaScript code into webpages. These extensions typically offer a user interface for selecting elements to block and managing custom rules.

The Challenge: Blocking Elements Without Blocking Ads

The main challenge lies in distinguishing between ads and non-ad elements. Many websites use similar naming conventions or structures for both, making it difficult for element blockers to selectively target non-ad elements without inadvertently blocking ads as well.

Furthermore, some ad blockers are designed to block all advertising by default, making it impossible to disable ad blocking while still using the element blocking feature. This is the core issue highlighted in the discussion I encountered.

Potential Solutions and Workarounds

So, how can we achieve element blocking without affecting ad display? Here are a few potential solutions:

1. Custom Filter Lists

Some ad blockers, like uBlock Origin, allow users to create custom filter lists. These lists can contain CSS selectors or JavaScript code to target specific elements. By carefully crafting these filters, you can block non-ad elements without blocking ads.

The Key: The trick is to identify unique attributes or patterns in the non-ad elements that distinguish them from ads. This may require some investigation of the website's HTML and CSS.

2. Dedicated Element Blocker Extensions

There are browser extensions specifically designed for element blocking. These extensions typically focus on providing a user-friendly interface for selecting and blocking elements without any built-in ad blocking functionality. By using a dedicated element blocker alongside an ad blocker, you can achieve granular control over what gets blocked.

Examples:

  • Element Hider: A simple extension that allows you to select and hide elements on a webpage.
  • Stylebot: An extension that lets you customize the appearance of websites using CSS. You can use it to hide elements by applying display: none; to them.

3. User Style Sheets

User style sheets are custom CSS files that you can apply to websites. Most browsers support user style sheets, allowing you to override the website's default styles. By creating a user style sheet with CSS rules to hide specific elements, you can achieve element blocking without using an ad blocker.

How to Use User Style Sheets:

  • Create a CSS file (e.g., custom.css) with your custom rules.
  • In your browser settings, specify the path to your CSS file as the user style sheet.

4. Browser Developer Tools

Most modern browsers have built-in developer tools that allow you to inspect and modify webpages. You can use these tools to identify and hide elements in real-time. While this approach is not as convenient as using an extension, it can be useful for temporary element blocking or for testing custom rules.

How to Use Developer Tools:

  • Open the developer tools (usually by pressing F12).
  • Select the element you want to hide.
  • In the Styles panel, add a display: none; rule.

5. DNS-Based Customization (Advanced Users)

For advanced users, a DNS-based solution like NextDNS offers extremely granular control. While primarily an ad blocker, NextDNS allows for the creation of custom rules that can block specific domains or subdomains associated with unwanted elements. This approach requires technical expertise but can be highly effective.

The Impact on Mobile Browsing

On mobile devices, the need for selective element blocking is even more pronounced. Mobile screens are smaller, and clutter can significantly impact the browsing experience. However, mobile browsers often have limited extension support, making it more challenging to implement element blocking solutions.

iOS

  • Safari Content Blockers: iOS Safari supports content blockers, which are essentially extensions that can block ads and other content. However, these content blockers are often limited in their functionality and may not offer the precision needed for selective element blocking.
  • User Style Sheets (Limited): While Safari doesn't natively support user style sheets, there are apps that can inject custom CSS into webpages.
  • DNS-Based Blocking: Using a DNS-based ad blocker like AdBlock for Mobile or NextDNS offers a system-wide solution that works across all apps and browsers. You can potentially customize blocklists to target specific elements, but this requires advanced configuration.

Android

  • Browser Extensions: Android browsers like Firefox and Kiwi Browser support extensions, allowing you to use dedicated element blocker extensions or custom filter lists.
  • User Style Sheets: Similar to desktop browsers, Android browsers also support user style sheets.
  • Local VPN Apps: Apps like Blokada create a local VPN to filter traffic, allowing for element blocking through custom rules. This approach works system-wide but may impact battery life.
  • Private DNS: Android's Private DNS feature allows you to use a DNS-based ad blocker like AdGuard DNS or Cloudflare 1.1.1.1. Customization options vary depending on the provider.

Privacy Considerations

It's important to consider the privacy implications of element blocking. While blocking annoying widgets and pop-ups can improve your browsing experience, it can also affect how websites track your behavior.

  • Cookie Consent Pop-ups: Blocking cookie consent pop-ups may prevent websites from setting cookies, but it can also break some websites that rely on cookies for functionality.
  • Social Media Widgets: Blocking social media widgets can prevent social media companies from tracking your browsing activity on other websites.
  • Custom Filters: Be careful when using custom filters, as they can potentially expose your browsing habits to third parties if not implemented correctly.

Performance Implications

Element blocking can also impact website performance. Hiding elements using CSS is generally less resource-intensive than removing them using JavaScript. However, excessive use of CSS rules can also slow down page rendering.

  • CSS Selectors: Using complex CSS selectors can be slow, especially on large webpages. Try to use simple and efficient selectors.
  • JavaScript Injection: Injecting JavaScript code can add overhead to page loading. Optimize your code to minimize performance impact.
  • Extension Overhead: Browser extensions can consume memory and CPU resources. Choose extensions that are lightweight and well-optimized.

My Recommendations

Based on my understanding, here’s what I’d suggest for different use cases:

"I want to block specific annoyances without affecting ads."

Dedicated Element Blocker Extension + Ad Blocker: Use a dedicated element blocker extension alongside a standard ad blocker. This gives you the most control over what gets blocked.

"I want a simple solution that works on mobile."

DNS-Based Blocking with Customization: Use a DNS-based ad blocker like NextDNS or AdGuard DNS and explore their customization options. This provides a system-wide solution with minimal setup.

"I'm concerned about privacy."

User Style Sheets + Privacy-Focused Browser: Use user style sheets to block unwanted elements and choose a privacy-focused browser like Brave or Firefox Focus.

"I'm a developer and want maximum control."

Browser Developer Tools + Custom Scripts: Use the browser developer tools to experiment with different blocking techniques and write custom scripts to automate the process.

Setting Up Your Chosen Method

Regardless of the approach you choose, the setup process will vary depending on your browser, operating system, and chosen tools. Here are some general guidelines:

Browser Extensions:

  1. Open your browser's extension store (e.g., Chrome Web Store, Firefox Add-ons).
  2. Search for the desired element blocker extension (e.g., Element Hider, Stylebot).
  3. Install the extension and follow its instructions for selecting and blocking elements.

User Style Sheets:

  1. Create a CSS file (e.g., custom.css) with your custom rules.
  2. In your browser settings, find the option to specify a user style sheet.
  3. Enter the path to your CSS file.

DNS-Based Blocking:

  1. Choose a DNS provider that offers customization options (e.g., NextDNS, AdGuard DNS).
  2. Create an account and configure your DNS settings on your device.
  3. Explore the provider's settings for creating custom rules or blocklists.

Detailed Setup Guides →

Final Thoughts

While achieving perfect element blocking without affecting ad display can be challenging, it is certainly possible with the right tools and techniques. By understanding the different approaches and their limitations, you can find a solution that meets your specific needs.

Remember that the best approach is the one that balances your desire for a clean browsing experience with your privacy and performance concerns. Experiment with different solutions and find what works best for you.

The ability to selectively block elements can significantly enhance your mobile browsing experience, allowing you to focus on the content that matters most to you. It's worth exploring the options available and taking control of your online experience.

Ready to Block Ads?

Follow my step-by-step guide and start browsing ad-free in under 30 seconds.

Get Started Free