How to filter out internal users

When you investigate an insight, you want to make sure you look at the best possible data and that your findings aren’t skewed. That means understanding the definition of events or actions you’re using and, if needed, filtering out internal users, beta testers, contractors, and agencies.

Filtering out these sorts of users is especially important for large organizations where there may be hundreds, or thousands of internal team members using your product. Same for early-stage startups, where such users may make up a larger proportion of the total due to the small sample size.

To make it easier to get accurate insights, PostHog includes tools to filter internal users out – and here’s how to use them.

Step 1: Navigate to project settings

PostHog identifies internal users on a project-by-project basis, so head to your project's Customization settings to get started. If your PostHog instance spans multiple projects then you must repeat this tutorial for each project.

Filter Internal Users Step 1

Any internal users you identify for a project will apply for all users on that project.

New projects start with one filter already in place. It excludes the Internal / Test users cohort, which contains anyone with the $internal_or_test_user person property set to true, plus anyone whose email ends with the domain of the person who created the project (unless it's a generic one like Gmail). To add yourself to this cohort, call posthog.setInternalOrTestUser() in your browser. You can keep this filter and add your own alongside it.

Step 2: Add an internal user filter

In project settings, scroll down to the Filter out internal and test users section and click + Filter (or Add filter if the list is empty) to begin.

Before you add one, know that these filters work the opposite way to how many people expect. You aren't writing a list that describes your team. Each filter describes the users you want to keep, and when the toggle is on, PostHog only shows events that match every filter. Write each one with a negative operator, such as doesn't end with, doesn't equal, or user not in.

Adding a filter here works exactly as it does in any insight, with a list of available event properties, person properties, and cohorts to choose from. You can add several filters at once, to create a list of ways to identify groups of internal users or beta testers.

One of the easiest filters to create is by email addresses. We do this at PostHog, using the following filter to create insights based only on users who do not have a PostHog email address:

email ⇻ (doesn’t end with) @posthog.com

This only catches people you've identified, because anonymous visitors don't have an email property.

Filter Internal Users Step 2

If the toggle seems to do the reverse, such as an insight or your session recordings showing only your team when it's on, check for a positive operator. A filter like email ends with @posthog.com, or a cohort filter with user in, keeps only those users instead of removing them.

Tip: Inline person property filters (e.g. "email does not end with @your-domain.com") work everywhere including real-time CDP destinations.

Alternatively, you can create a cohort and add it with a "not in" operator – this works well for analytics queries (insights, dashboards) and also works in CDP destinations if the cohort contains exclusively person property filters. Cohorts with behavioral filters or no properties defined will cause CDP destinations to error.

Step 3: Add more filters

PostHog supports adding multiple filters at once, as well as complex filters with multiple values within them.

You can create filters which include more than one value by separating values with a comma. We use such a filter to exclude events from local development environments, for example:

Host ≠ (doesn’t equal) localhost:8000,localhost:5000,127.0.0.1:8000

You can also create filters based on pre-prepared cohorts of users, which is especially useful if you’re using cohorts with Feature Flags or to run Experiments. To do this, select the cohort you wish to add to your internal and test user list, and choose user not in.

Step 4: Apply the filter to your insights

Filter Internal Users Step 3

The internal and test user filter is controlled with a simple toggle whenever you create a new insight, or edit an existing one. Turn it on and everything in your filter group will be sifted out; turn it off and you’ll see results from all users together.

Defining your filters doesn't switch them on, so this toggle decides whether an insight excludes internal users. You can also set it from project settings, without opening each insight.

Set the default for new insights

Enable this filter on all new insights sets the starting value for insights created from then on. It doesn't change insights that already exist.

Change every insight you already have

Under Existing insights, Turn on for existing insights and Turn off for existing insights set the toggle for every insight in the project, including insights other people created. Run this after setting up your filters for the first time, so your existing dashboards and insights stop counting internal traffic. You need to be a project admin.

Some insights are left as they are:

  • SQL insights. These have no such toggle, so write the exclusion into the query itself if you need it.
  • Insights you can't edit. An organization admin can cover those, or you can ask for edit access.
  • Insights saved in an older format. These keep whatever they were set to. Open one and save it to convert it, then run this again.

After each run, PostHog tells you how many insights it changed, how many already matched, and how many it left alone.

Dashboards show whatever their insights are set to. A dashboard with its own override for this filter keeps that override.

You can also run this over the API. See internal and test users for the endpoint.

Note: There's no bulk undo. Running it the other way sets every insight to the opposite value, rather than restoring what each one had before. To recover a single insight, open its activity log: each change records the previous query, so you can see what it was set to and set it back by hand.

Subscribe to our newsletter

build mode

Read by 75,000+ founders and builders

We'll share your email with Substack

PostHog is your product's context layer. With a full suite of developer tools – AI observability, product analytics, session replay, feature flags, experiments, error tracking, logs, and more – PostHog ingests and stores all the data agents need to diagnose problems, uncover opportunities, and ship fixes. A data warehouse and CDP tie it all together, unifying that context into one source agents can read across. You can steer it all from Slack, the web app, the desktop (PostHog Desktop), or your own editor via the MCP.

Community questions