How to filter multiple IP addresses (with a single filter) in Google Analytics

When setting up Google Analytics for a client, one of the first things I do is create an ‘Internal Traffic Filter’. For sites with low traffic volumes, it’s imperative to have the most accurate data possible – so removing internal traffic from you and your client will help.

To begin filtering out internal hits from you and your client, you will need to ensure that both parties have a Static IP address(es) that you can specifically target with a filter.

Filters can be applied at the ‘View’ Level of your individual accounts within Google Analytics. Any data or hits that are excluded by a filter cannot be recovered later, so it’s best practice to keep an unfiltered view of your data too.


Select the Property View that you wish to apply the Internal Traffic Filter to.

Filtering a Single IP Address

As an example, If all internal traffic from your agency comes from a sole IP, filtering hits from this location is relatively straight forward. Follow the steps in the diagram below to create a new filter that will exclude hits from the IP that you specify.


Filtering Multiple IP Addresses

Let’s say however you also wanted to filter out your client’s office’s internal traffic, but they access the site from three completely different IP addresses. You could set-up three separate filters, but for the sake of simplicity and best practice; it’s possible to specify these within a single filter pattern using a Custom Filter and a regular expression for the Filter Pattern:


As you can see in the diagram above, multiple IP addresses can be separated with pipes (|), but it’s important to precede each dot with a backslash so that it’s treated as a regular full stop.

It’s as simple is that. Be sure to test that your filters are working correctly by heading over to Real Time Analytics within reporting to ensure your activity is not being recorded.

  • Vivekanand Selvaraj

    #James – This article really great, It resolve my questions about filtering Local IP.

    • James Bavington

      Great to hear that you found it useful!

  • neha varma

    Why we need to filter ips???

    • James Bavington

      If you wish to exclude traffic from yourself (either the marketing agency or the client) to ensure that all data is the general public accessing the website. Optional of course.

  • MashWebDesign

    Cracking article James, Didn’t have a clue you could filter multiple IP’s using regular expressions. Will be using this method going forward!

    • James Bavington

      Thanks, we’ve have a range of three here at Creare, so I wanted to keep it tidy within a single Filter!

      • MashWebDesign

        Ahh keep the analytics accurate, crucial really. Looking forward to more tutorials! PS Did Sam ever show you the new

  • Marc B

    Hey James,

    I’m not used to regular expression. This article here

    from google shows a more complex expression. Why is that?

    • James Bavington

      Hi Marc, in that example Google are showing you how to filter a range of IP addresses. For example > so that you’d also capture the ranges in-between 1 and 5 like Hope that makes sense?

  • Nolan

    Hi. Can you upload a list of IP addresses to exclude. I have a new client who has 4500 employees all over the world and it is skewing the data big time!

    • James Bavington

      I don’t think you can upload a list of IPs sadly. Unless they have a common pattern that you can target with a regular expression, I don’t think there’s an easy way of blocking their IPs. Are the employees logged into the site at all when they access it? You could consider removing analytics tracking for those sessions if they can be identified as employees whilst browsing the site?

  • Peter

    I set up the filter to filter out my visits from my static IP addres, but when I go to Real Time Analytics, it’s showing that my visit to the website in real time. Does that mean that the filter is not working properly?

    • James Bavington

      If it’s definitely your IP showing in the realtime, and it’s still happening now – then it would suggest the filter isn’t set-up correctly or applied to the correct view? IT may be worth double checking your IP and that the filter is applied to the correct view within Analytics.

      • Laurentiu Bancu

        I have the same problem. The filter is set up correctly (we have a fixed IP address), it has been applied to all views, but in Real Time analytics is showing traffic from our IP. What can be wrong?

        • Alex Davison

          Hi, late response here but better late than never I guess.
          Real Time is not affected by filters, so will continue to show your traffic. The filter will only affect the standard and custom reports.

  • Milosz_Krasinski

    Thank You for that James. This post really sorted my problem. Would be useful to find out solution for Nolan’s 4K IP’s question.

    • James Bavington

      Thank you Milosz, great to hear that this has helped with your traffic filtering. I’ve just replied to Nolan’s question if that helps.

  • Domex Technical Information

    Thanks for providing this information. I also used this information from our site for block our office ip addresses.

  • Brian Sorce

    What if you have over 1,000 ips? The character amount allowed is only 255?

    • James Bavington

      Hi Brian, are you not able to write a regular expression to catch them in an easier way? i.e. if there are any aspects of the 1000’s of I.Ps that are shared, you can do a pattern match?

      • Courtney Jordan

        I have the same problem – I have well over 600 chars in my office ips and only a few that can be matched at even the second level (210.24, for ex). I believe that’s still not specific enough to only trap internal traffic. We want to view all, external, and internal. But have international company with offices worldwide and lots of remote employees. Any ideas would be greatly appreciated!

        • Marco Peters

          I am having the same problem. 480 characters.

          • Daniel Eddington

            Cut them in half and create two different filters..? Seems pretty obvious to me.

  • Monabelle Salaan

    Followed Format #6. It’s not working, it said “Invalid IP address”.

    • Anton Hilton

      You need to click on ‘custom’, which is next to ‘predefined’ and then follow this process.

      • Jason Flaherty

        This was really helpful! Thanks!

  • Lindsay

    Do you need a static ip address to create a filter? Can you google what your IP address is or do you have to create one manually?

    • Alex Davison

      If you google “What is my IP” google usually now responds with the answer, however if it doesn’t there are plenty of sites that can help. If you don’t have a static IP then you can’t guarantee that this will work indefinitely; however I have found in practice that even dynamic IPs rarely change on fixed broadband links.