How to Filter Internal and Test Users in PostHog (and What the Filter Does Not Do)

Each rule describes traffic to keep. Test an employee, a customer and an anonymous visitor before applying the rules to saved reports.

Part of PostHog Audit: 12 Checks Before You Trust the Data.

An insight card with a switched-on toggle labelled Filter on shows a row of eight people, three of them only dashed outlines. Below it, a PostHog storage tray labelled Still ingested holds the same eight people, all solid, the same three wearing ID badges on lanyards; an arrow rises from the tray to the card.

Open Settings → Project → Filter out internal and test users to define the traffic your reports should exclude. Editing the list needs project-admin access. (+)

This is an analysis filter. Captured events stay stored and visible in Activity, and still count toward billable usage. (+) Hiding an event in a report leaves its collection unchanged; stopping capture needs a separate control.

Why You Should Filter Internal Users in PostHog

An employee can repeat an onboarding flow dozens of times while a customer tries it once. Counting both together changes the funnel’s population and can hide where customers struggle. Decide which activity belongs in the metric before choosing a filter.

This filter is one of the twelve checks before you trust the data. The audit also tests whether the events, identities and purchase values support the decision you want to make.

1. Go to Settings

In the project settings section named above, choose Add filter. Start with an internal account you can recognize and an event you can inspect; a property name alone does not tell you whether it identifies employees.

PostHog Settings page showing the "Filter out internal and test users" section and Add filter button.
2025 capture of the earlier settings interface. Current settings add actions for existing insights, covered in step 4.

2. Add Filtering Rules

Choose signals from actual events and profiles. The examples below show how to write exclusions; replace the domains and hosts with values you have checked.

Filter by host: localhost, staging and preview environments

Inspect $host on a development event. To cover local addresses with optional ports, choose the regex operator and use this rule:

$host does not match regex ^(localhost|127\.0\.0\.1|0\.0\.0\.0)(:\d+)?$

For staging and preview, use $host is not staging.yourproduct.com and the observed preview host. One rule can also list several exact hosts, comma-separated, with “doesn’t equal”. (+) A regex needs “does not match regex”, a separate operator from exact matching. (+)

A backend purchase may have no browser host. Check that case before using this rule across a report that combines browser and server events.

PostHog Host filter using a regular expression to exclude localhost and local development addresses.
Host rule in the earlier settings interface (2025). Use the regex operator described above.

Filter by email or an internal-account property

For employees with company accounts, use the inline person-property rule email does not end with @yourdomain.com. Inline person-property filters work across surfaces, including real-time CDP destinations.

An application-owned is_employee or is_test_user property can cover testers who use other domains. Set the classification from trusted account data, inspect its presence, and test what happens when the property is absent.

You can also create an Internal team cohort and select “not in”. The cohort guidance supports this in insights and dashboards. (+) In destinations, the cohort must contain person-property filters alone; behavioural filters or an empty definition cause errors.

A bug report opened on 16 October 2025 describes cohort exclusions also removing anonymous visitors. (+) That is a reported failure; it does not describe every project. We recommend the inline filter when anonymous traffic matters, followed by the validation below.

PostHog Email address filter using a "doesn't contain" rule.
Email rule in the earlier settings interface (2025). The text above gives the exact-domain and cohort guidance.

Treat device name as a weak signal

A device label is useful only if you have checked that it identifies your test environment. A label shared by customer devices removes those customers too. Prefer an account or environment marker when a simulator has no distinct, consistently populated value.

PostHog Device name filter excluding Simulator iOS, with the global filter enabled.
Device rule in the earlier settings interface (2025). Check that the value identifies test devices.

Treat country as a market restriction

Your team’s country also contains potential customers. Excluding it changes the market represented by the report. Use geography only when that restriction belongs in the metric definition, and record which customers it removes.

PostHog Country name filter excluding a selected country value.
Country rule in the earlier settings interface (2025). This excludes customers in that country too.

Filter by a verified public office or VPN IP

Use an IP rule only after confirming the public office or dedicated VPN exit address on an internal event. A private LAN address does not identify that public exit. Dynamic home addresses miss employees when they change; shared VPN exits can exclude customers.

Use an exact exclusion on the property that actually holds the observed address. The IP-to-person-property note serves ad destinations that need the visitor’s IP; copying an IP onto a profile is a separate task from defining this analysis rule.

PostHog IP address filter listing multiple excluded IP values.
IP rule in the earlier settings interface (2025). Use only a verified public exit address.

If your implementation already extracts an opaque QA marker from a URL, inspect the resulting property before filtering on it. Define its lifetime so a later customer session does not inherit test status. Avoid putting employee emails in links: URLs can be copied into logs, referrers and analytics.

PostHog URL parameter filter applying a "doesn't contain" rule to url_email.
URL-property rule in the earlier settings interface (2025). Prefer an opaque test marker to an email in a URL.

3. Use Multiple Filters if Needed

Entries combine with AND: an event is shown only if it matches every entry, so a customer event must pass both the employee exclusion and the staging exclusion. (+)

RuleWhat it keeps
email contains @company.comOnly matching company accounts. A customer-only insight becomes empty when none of its events has that email.
email does not end with @company.comAccounts outside that exact domain; verify visitors without email separately.

Add one rule at a time. Every extra condition creates another way to remove legitimate events. Record the property, its sender and the intended missing-value behaviour in your event tracking plan.

4. Apply Globally or Per Insight

There are three ways to apply the filter: turn it on in an individual insight; set Enable this filter on all new insights for future insights; or, as a project admin, choose Turn on for existing insights. (+)

Bulk changes have no bulk undo. An insight’s activity log records its previous query for manual restoration. Keep a record of intentional exceptions before changing existing insights.

The API equivalent is POST /api/projects/:project_id/insights/bulk_set_test_account_filter/ with {"enabled": true}, sent with an insight:write key that belongs to a project admin. (+)

SurfaceWhat to check
Saved insights and dashboardsInspect the insight toggle and any dashboard override. A dashboard override retains its own setting after the underlying insights change.
SQL insightsThere is no internal-user toggle. Put the required exclusion in the query and compare its result with a known internal case.
Web analytics, revenue analytics and session replayEach applies the project filter list. Check the control and the result on each surface you use.
CDP destinationsInspect each destination’s filter state and use the supported person-property or cohort definition described above.

Experiments are the exception: their filter test accounts toggle removes internal users from the analysis only. (+) The flag still serves employees a variant unless its release conditions exclude them, so exclude them there too. PostHog keeps the complete list of surfaces the filter reaches.

Validate with a known internal session

Trigger a known employee event and find it in Activity. Copy an insight, fix its event, counting unit and date range, and compare the filter off with the filter on. Keep every other setting fixed. These are the acceptance results to look for:

CaseFilter offFilter on
Known employee on productionVisible if capturedExcluded
Known customerVisibleStill visible
Anonymous visitor with no emailVisibleStill visible when anonymous traffic belongs in the metric
Staging eventVisible if capturedExcluded by the staging rule
Backend customer purchase with no $hostVisibleStill visible through the intended account or environment classification

If a customer disappears, remove the newest condition and inspect its property values and missing-value behaviour. If an employee remains, inspect operator direction and identity. Save the passing cases so you can repeat them after SDK, authentication or environment changes.

When to stop capturing instead

Keep selected QA events when they help debug releases. When development volume has no analytical use, prevent it from reaching production. PostHog recommends separate development, staging and production projects; the free plan includes one project, and usage across projects shares one bill and allowance. (+)

On a localhost browser, the JavaScript SDK’s opt_out_capturing() stops capture. (+) Configure that gate before unwanted capture begins; opting out later cannot unsend earlier requests. Apply gates to every sender, including mobile SDKs, server jobs and payment webhooks.

Separating projects preserves test data while moving it out of production reports. Preventing capture also removes that event volume from future usage. Use the PostHog cost guide to decide which capture you can stop without losing evidence you need.

Frequently asked questions

Who should count as an internal user?

Include employees, contractors and QA accounts whose activity falls outside the customer question. A partner doing real customer work may belong in the metric; write down the distinction before excluding everyone at that company.

What if staff also use the product as paying customers?

Separate their test accounts or test flows from their customer activity where you can. Excluding their entire identity would also remove legitimate usage. Record the remaining ambiguity if your events cannot distinguish the two.

How should a remote team handle changing networks?

Maintain an account-based employee or tester classification. Assign someone to update it when people join, leave or change accounts; an expanding list of home IPs is difficult to keep accurate.

Can I clean historical data with no internal marker?

Use only evidence that exists for the period, such as known accounts or observed staging hosts. Adding a marker today does not supply it to old events. State the uncovered period rather than claiming the history is clean.

Why does the result look unchanged after I edit the list?

Because cached results can persist for several hours. (+) Refresh the insight, or use the reload control in web analytics, before judging the change.

Why were some insights skipped by the bulk action?

The bulk action skips SQL insights, insights you cannot access and older saved formats. (+) Ask an organization admin about access; open and save an older-format insight before rerunning the action.

What should I record for the next person maintaining this?

Keep the reason for each rule, its source property, a known included and excluded case, and the reports with intentional exceptions. Recheck that record when staff accounts, preview hosts or network exits change.

About the author

Amin Heshmati

Amin Heshmati

Amin Heshmati is an author at 99Ways focused on PostHog, conversion optimization, experimentation, attribution, and analytics implementation. He writes about building reliable measurement systems and using data to improve digital performance.

More articles

Where is growth getting stuck?

Book a free 45-minute call with Iman. Show him your site and, if you can, your analytics. You’ll leave knowing what to fix or test first.

Book a free call