> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safesquid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Block Advertisements And Banners

> Block ads and banners in SafeSquid to improve load time, security, and bandwidth and reduce distractions.

## Problem

Security teams need predictable control over app and web usage to reduce policy bypass and data-risk exposure.

## Benefits

You can enforce policy decisions consistently with SafeSquid while preserving legitimate business workflows.

## Advantages

You keep actionable policy control close to operations, with verifiable outcomes in logs and policy behavior.

## Call to action

Use the steps in this guide to implement the control, then validate behavior with a real user-flow test.

# Block advertisements and banners

## Ads create security risk, waste bandwidth, and hurt user experience

Ad networks can deliver malware, tracking, and unwanted scripts; ads also increase load time and bandwidth use. Blocking ads at the gateway reduces exposure to ad-based threats, improves performance, and supports acceptable-use policy. SafeSquid BLOCK ADVERTISEMENT policy replaces ad content with a configurable template so users see cleaner pages without client-side ad blockers.

## Key benefits

Reduces malware and tracking exposure from ad networks. Lowers bandwidth and CPU use. Cleaner pages with fewer distractions. Evidence for auditors: policy is visible in **Configure** → **Access Profiles** (or **Templates**); access logs show traffic that matched the policy. **Limitation:** Some sites may break if they depend on specific ad endpoints; use bypass or allow rules for exceptions.

## Prerequisites

**SafeSquid-side:** HTTPS Inspection enabled so SafeSquid can inspect and modify HTTPS content. See [Configure HTTPS Inspection](/Configure_HTTPS_Inspection) if not yet enabled. Admin access to the Configuration Portal.

**Client-side:** No change required; blocking is transparent.

## Enable BLOCK ADVERTISEMENT policy

1. Access the SafeSquid interface via the [Configuration Portal](/Configuration_Portal) — web interface for policy and system settings. In the interface header, click **Configure** to open the configuration menu.

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image1.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=85ffc81f58263201d62ad783a0f107c9" alt="Configuration Portal header with Configure menu highlighted" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image1.webp" />

2. In **Access Profiles** (or **Templates**), use the search box to find the default policy; search for **BLOCK ADVERTISEMENT**.

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image2.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=8697e67ce8b326dff61a4d8ff94dfb89" alt="Search box in Access Profiles or Templates list" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image2.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image3.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=6bcbb4631d475690423ea0b21b1b1c52" alt="Search for BLOCK ADVERTISEMENT default policy" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image3.webp" />

3. Open the policy: click **Edit** on the BLOCK ADVERTISEMENT row to open the policy editor. Set **Enabled** to **TRUE**, then click **Save** (or the equivalent save control in the policy section) to save the policy.

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image4.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=a667e88e74c5bced18355bdd49699ef4" alt="Edit button on the BLOCK ADVERTISEMENT policy row" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image4.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image5.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=7aaa3873e94fa7e596678f5c1f318baf" alt="Enabled toggle set to TRUE in the policy form" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image5.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image6.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=b5a07e43134f7508cce8b5e1b40f6282" alt="Save button to persist the policy changes" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image6.webp" />

4. Alternatively, enable from **Templates** in custom settings: open the BLOCK ADVERTISEMENT template, set **Enabled** to **TRUE**, and save.

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image7.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=f8e60942c886b2138931ae0224402d77" alt="Enable BLOCK ADVERTISEMENT from Templates in custom settings" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image7.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image8.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=63efde48f866295d299121f56d443d0e" alt="Set Enabled to True in template" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image8.webp" />

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image9.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=05e1971efcfd97bd75bc05cefb1c8fb9" alt="Save the template" width="1280" height="720" data-path="images/How_To/Block_Advertisements_And_Banners/image9.webp" />

## Verification and Evidence

* **Interface:** **Configure** → **Access Profiles** (or **Templates**) shows BLOCK ADVERTISEMENT with **Enabled** TRUE.
* **Traffic:** Open a site that normally shows ads (e.g. [https://www.youtube.com/](https://www.youtube.com/)); ads should be replaced by the SafeSquid template.

<img src="https://mintcdn.com/safe-squid-labs-12a0916f/RBjPd0RQsKIeayde/images/How_To/Block_Advertisements_And_Banners/image10.webp?fit=max&auto=format&n=RBjPd0RQsKIeayde&q=85&s=f225b1742c4ae0b21051aa2ca64d80eb" alt="Blocked ad replaced by SafeSquid template on YouTube" width="853" height="261" data-path="images/How_To/Block_Advertisements_And_Banners/image10.webp" />

* **Audit:** Access logs and reports show traffic matching the policy; export reports from the [Reporting Module](/Reporting_Module) for evidence.

:::note
Administrators can replace the default template with a custom template.
:::

## Troubleshooting

| Symptom                    | Likely cause                                       | Resolution                                                                                           | Verification                               |
| -------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Ads still visible          | HTTPS Inspection not enabled or policy not applied | Enable HTTPS Inspection; ensure BLOCK ADVERTISEMENT is enabled and profile applied to the connection | Reload page; confirm template replaces ads |
| Site broken or login fails | Site depends on blocked ad domain                  | Add bypass or allow rule for that domain or path                                                     | Retest site after rule change              |
| Policy not in list         | Default policies not loaded                        | Restore defaults or contact support for policy set                                                   | Search again in Access Profiles            |

## Next steps

* [Block inappropriate images using Image Analyzer](/Block_inappropriate_images_by_using_Image_Analyzer) for visual content filtering.
* [Header Re-Write](/Header_Obfuscation) for header filtering and privacy.
* [Content Modifier](/Content_Modifier) for custom regex-based content rewriting.


## Related topics

- [Content rewrite](/admin_guide/filtering_and_privacy/content_modifier.md)
- [Header filter](/admin_guide/filtering_and_privacy/header_filter.md)
- [High Availability with Monit and Keepalived](/use_cases/scaling_and_high_availability/ha_monit_keepalived.md)
- [Manage Subscription State](/deployment/manage_subscription_state.md)
- [Block Specific YouTube Channel](/use_cases/access_restriction/block_specific_youtube_channel.md)
