How to Remove a Domain from Google Analytics

Cody Schneider8 min read

Need to clean up your Google Analytics account by removing an old or irrelevant domain? You've probably already discovered there isn't a simple "delete domain" button. This guide breaks down exactly how to handle it, whether you're trying to stop tracking a specific site, delete an entire property, or just filter out unwanted traffic for cleaner reports.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Why You Can't Just 'Delete a Domain' in Google Analytics 4

Before we get into the step-by-step instructions, it helps to understand how Google Analytics 4 thinks about your website. In the past with Universal Analytics, you had a tracking ID for a specific property, which was usually tied to one domain. GA4 changed this structure to be more flexible and user-centric.

The new structure is:

  • Account: The highest level, usually your company.
  • Property: This represents your business's web and/or app presence. You might have one property for your e-commerce brand that collects data from both your website and your mobile app.
  • Data Stream: This is the specific source of data feeding into your property. For a website, it's a web data stream. For an app, it's an app data stream.

The key takeaway is that deleting a "domain" isn't a feature because the domain itself is just one source of data (a data stream) that flows into the larger container (the property). To remove a domain, you need to address the flow of data from that source. Let's look at the most common scenarios and what to do for each.

Scenario 1: You Want to Stop Tracking One Specific Domain

This is the most common situation. Imagine you track yourmainbiz.com and an old blog, myoldblog.com, within the same GA4 property. You've now shut down the blog and want to stop its data from muddying your main site's reports moving forward.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

The Short Answer: Remove the Tracking Code

The simplest and most direct way to stop Google Analytics from "seeing" your domain is to remove its ability to see it. If you remove the GA4 tracking code from the website's files, Google's servers will no longer receive any data from that domain. No new data means no new reports for that site.

Here’s the general process:

  1. Log Into Your Website’s Backend: This could be your WordPress dashboard, Shopify admin, Squarespace editor, or the file system of a custom-coded website.
  2. Locate Your Website's Header File: You’re looking for the section of your site’s code that appears on every single page, usually within the <head> HTML tags. In WordPress, this is often handled by a theme file (like header.php) or a dedicated plugin/setting for adding custom scripts.
  3. Find and Delete the Google Analytics Script: The GA4 Global Site Tag (gtag.js) script looks like this. Your "G-XXXXXXXXXX" Measurement ID will be unique to your data stream.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
    window.dataLayer = window.dataLayer || [],
    function gtag(){dataLayer.push(arguments),}
    gtag('js', new Date()),

    gtag('config', 'G-XXXXXXXXXX'),
</script>

Carefully delete this entire block of code from your site's header.

  1. Clear Caches and Save: Save your changes. If you are using any caching plugins or services (like Cloudflare), clear your cache to make sure the updated, code-free version of your site is being served to new visitors.

How to Confirm the Tracking Code is Gone

Not sure if you got it right? You can easily check if a site has Google Analytics tracking installed.

  • Use Your Browser's Inspector: Right-click on your webpage, select "View Page Source," and use your browser's find function (Ctrl+F or Cmd+F) to search for "gtag.js". If you don't find it, the code has been successfully removed.
  • Use a Chrome Extension: Install the "Tag Assistant Legacy (by Google)" extension for Chrome. Visit the website in question, enable the extension, and reload the page. It will show you a list of all Google tags firing on that page. If the list is empty or your GA tag isn't there, you're all set.

Important: This method only stops the collection of new data. All historical data from that domain will remain in your Google Analytics property. There is no way to retroactively remove only one domain's past data from a property that also contains data from other domains.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Scenario 2: You Need to Delete the Entire Property (and Its Domain)

Sometimes you need a more drastic solution. If you sold a business, discontinued a project entirely, or just made a complete mess of the initial setup and want to start fresh, deleting the entire GA4 Property is the way to go.

Warning: This action is permanent. Once the grace period is over, all historical data associated with this property will be gone forever. You cannot undo this. Be 100% sure before proceeding.

Here’s how to move a GA4 property to the trash can:

  1. Go to Your GA4 Admin Panel: Log in to Google Analytics and click the gear icon labeled "Admin" in the bottom-left corner.
  2. Select the Correct Account and Property: Use the dropdown menus at the top of the Admin page to choose the correct Account and the Property you wish to delete.
  3. Open Property Settings: In the "Property" column (the middle one), click on "Property Settings."
  4. Move to Trash Can: In the top right corner of the Property Settings screen, you'll see a button labeled "Move to Trash Can." Click it.
  5. Confirm the Deletion: Google will give you a final warning screen explaining what will happen. Read it carefully, acknowledge the terms, and confirm your choice.

The property is now in the trash. It will be permanently deleted after 35 days. If you make a mistake, you can restore it from the "Trash Can" section within the Account settings during this grace period.

Scenario 3: You're Seeing Spammy Referral Domains You Want to Remove

This is a slightly different but related problem. Your own domain is fine, but when you look at your referral traffic reports, you see junk from spammy or bot-driven domains (like spam-referral-site.com). This can inflate your traffic numbers and distort your data.

This isn’t about removing your own tracking, but about telling GA to ignore incoming traffic from specific domains. Here's how to set up referral exclusions:

  1. Go to Admin > Data Streams: Navigate to the Admin panel and in the Property column, click "Data Streams."
  2. Select Your Web Stream: Click on your primary web data stream to open its details panel.
  3. Configure Tag Settings: Scroll down and click on "Configure tag settings."
  4. List Unwanted Referrals: On the Configuration screen, click the "Show all" button to expand the settings list, then select "List unwanted referrals."
  5. Add the Spam Domain: Under the "Match type" dropdown, select "Referral domain contains" and then enter the domain you want to block (e.g., spam-referral-site.com). Click "Add condition" to add more if needed.
  6. Save Your Changes: Click "Save" in the top-right corner.

From this point forward, any traffic coming from the domains you listed will no longer be counted as referral traffic. It will likely be categorized as (direct)/(none) traffic instead, effectively cleaning it from your go-to reports.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Bonus Tip: Filtering Out Specific Subdomain Traffic

What if you want to keep tracking your whole domain but exclude a specific part of it, like a development or staging site (e.g., dev.yourwebsite.com)? You can do this by creating a filter to exclude internal or developer traffic based on the hostname.

  1. Navigate to Admin > Data Settings > Data Filters.
  2. Click "Create Filter," choose the "Developer Traffic" preset.
  3. Give your filter a name, like "Exclude Dev Site." Set the filter operation to "Exclude."
  4. Define the filter rule where the "Hostname" parameter is exactly "equal to," and enter the full subdomain (e.g., dev.yourwebsite.com).
  5. Activate your filter. After a short period, GA4 will stop processing and showing data for hits coming from that specific subdomain.

Final Thoughts

Removing a domain from Google Analytics isn't about finding a hidden delete button, but about strategically managing how data flows into your property. By removing tracking code, deleting unneeded properties, or using filters to clean up referral traffic, you can take control of your account and ensure your reports reflect just the data you care about.

We know that navigating analytics platforms to get a clear picture of performance can be frustrating. That's why we built Graphed to simplify the entire reporting process from start to finish. Instead of getting lost in admin settings, you can connect your data sources once and use simple English to build the exact dashboards you need with live, real-time data. If you’d like to spend time acting on insights instead of configuring reports, give Graphed a try.

Related Articles