# Exclude pages

Stop tracking admin screens, previews and other paths with data-exclude, or turn tracking off for your own browser.

Use `data-exclude` on the script tag to list paths that are never tracked. Events of any kind, including custom events and `identify`, are dropped in the browser while the current path matches.

```html
<script defer data-site="SITE_ID" data-exclude="/admin/*,/preview,/account/*" src="https://api.productlense.app/a.js"></script>
```

## Pattern rules

- A comma-separated list of path patterns; spaces around commas are ignored.
- `*` is the only wildcard and matches any characters, including `/`.
- Each pattern must match the whole path, from the leading `/`. `/admin` does not match `/admin/users`; use `/admin*` or `/admin/*`.
- The query string and hash are not part of the path.

| Pattern | Matches | Does not match |
|---|---|---|
| `/admin/*` | `/admin/users`, `/admin/users/42` | `/admin` |
| `/admin*` | `/admin`, `/admin/users`, `/administrator` | `/blog/admin` |
| `/preview` | `/preview` | `/preview/1` |
| `*/edit` | `/posts/7/edit` | `/posts/7/edit/raw` |

## Exclude your own visits

Open your site once with `?pl_ignore=1` and the script stops sending from that browser, or use the switch in Settings → Exclusions, which does the same. See [Exclude your own visits](/docs/track/exclude-your-visits).

For a page you control in code, `window.__pl_disable = true` set before the script runs sends nothing from that page. The script also sends nothing on `localhost` (unless `data-dev="true"`) and nothing from automated browsers that set `navigator.webdriver`.

> [!NOTE]
> ProductLense does not read Do Not Track or Global Privacy Control. It sets no cookies and stores no IP addresses; see [Cookieless visitor counting](/docs/privacy/cookieless-counting).

## Exclude a whole hostname

Events are accepted only from the hostnames set on the site. Staging hosts that are not listed are rejected by the server, so you can leave the script on staging without polluting your numbers.
