# Excluded pages

Stop counting an admin area, a signed-in app or a staging host, the way robots.txt keeps crawlers out.

Excluded pages are the parts of a site that never count, the way robots.txt tells crawlers where not to go. Use them for an admin area, a signed-in app on the same domain, a staging host, internal tools, or pages whose address holds a personal ID.

Nothing from an excluded page is stored: no pageview, custom event, outbound click, page load or web vitals sample. Excluded events do not count toward your plan's monthly events. Every plan has them.

## Add a rule

Owners and admins add rules in the site's settings, under Excluded pages. Everyone else in the organization sees the list.

### Pick Exclude or Include
Exclude stops counting the pages a pattern matches. Include brings pages back from a wider rule, the way Allow does in robots.txt.

### Type the pattern
The field offers the pages visited in the last 30 days, the site's sections and its sitemap. Pick one or type your own.

### Check the preview
While you type, the form shows what the rule would have kept out over the last 30 days: the pageviews, the five busiest pages and the custom events sent from them. An Include shows what it brings back.

A rule takes effect within a minute. Events already stored stay in your reports and exports.

## Patterns

A pattern matches the whole path, and `*` matches any run of characters, slashes included.

| Pattern | Matches |
|---|---|
| `/admin/*` | Every page under `/admin`, but not `/admin` itself |
| `/admin*` | `/admin`, every page under it, and `/administrator` too |
| `/account/*/invoices` | `/account/42/invoices` and `/account/acme/invoices` |
| `staging.example.com` | Every page on that subdomain |
| `app.example.com/settings/*` | The settings pages of that subdomain only |
| `*.example.com` | Every subdomain of example.com, but not example.com itself |
| `/#/admin/*` | The admin routes of an app that routes by hash |

A pattern that starts with `/` applies on every host the site accepts. A pattern that starts with a host applies only there. The host must be the site's domain or one of its subdomains.

Matching is case-sensitive, like the paths in your reports. It ignores the query string, and the fragment unless it starts a hash route like `/#/admin`, so the form refuses a pattern with `?` or any other `#`.

## When rules overlap

When several rules match a page, the longest pattern wins. On a tie, Include wins. The order of the list does not matter.

To count only the signup page of an account area, exclude `/account/*` and include `/account/signup`. The Include is longer, so it decides for the signup page, and the Exclude decides for every other account page.

## Goals and funnels

Goals, funnels, alerts and realtime see the site without its excluded pages. A goal or a funnel step whose page a rule keeps out stops counting new visits. The form says so before you add the rule, such as "This stops /thanks, which the goal Signup counts". The goals page marks a goal that a rule stops.

## Where the visit came from

When a visit lands on an excluded page and moves on to a counted one, the visit keeps its source, campaign and click ID, and starts on the first counted page. A visit that never reaches a counted page leaves nothing.

## From an agent or the API

The [MCP server](/docs/api/mcp) has `list_page_rules`, `create_page_rule` and `delete_page_rule`. When an agent adds a rule, it hears what the rule would have kept out and which goals it stops.

To keep the rules in your own code, send the whole list with a key that has `sites:write`. The request replaces the site's rules. Rules already in the list keep who added them and when, and an empty list removes every rule.

```bash
curl -X PUT https://api.ultanimus.com/v1/sites/YOUR_SITE_ID/page-rules \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rules":[{"pattern":"/admin/*"},{"pattern":"/account/*"},{"pattern":"/account/signup","include":true}]}'
```

The organization's audit log records every rule added or removed, with the person or key that did it.

## Limits

A site holds up to 50 rules of up to 200 characters each. Use `*` so one rule covers many pages.

The browser still sends an excluded event, and the server drops it on arrival. So rules need no change on your site, and work with the snippet, the npm packages, website builders and server events. To keep an ID in an address from leaving the browser at all, replace it with a [`url` function](/docs/tracking/page-addresses).
