# Excluding A page from tracking

**URL:** <https://community.hubspot.com/t/excluding-a-page-from-tracking/49517>\
**Category:** CMS Development\
**Tags:** javascript, html\
**Created:** [January 10, 2022, 11:29pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517 "2022-01-10T23:29:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chapster5](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Chapster5](https://community.hubspot.com/u/Chapster5)\
**Post date:** [January 10, 2022, 11:29pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517/1 "2022-01-10T23:29:24Z")

</div>

Hi all,

So with Hubspot is there a way exclude just one page from the tracking system on Wordpress? Say the page slug is Shop anyone who goes through the site to shop just needs to be ignored.

I’ve read this thread

[https://community.hubspot.com/t5/APIs-Integrations/Excluding-a-URL-from-Hubspot-tracking-on-a-WP-site/m-p/228049#M6945](https://community.hubspot.com/t5/APIs-Integrations/Excluding-a-URL-from-Hubspot-tracking-on-a-WP-site/m-p/228049#M6945)

And this code is apparently how you do it…

```auto
<?php if (is_page('PAGE SLUG GOES HERE')) { ?>

<?php } else { ?>

<!-- ADD HUBSPOT TRACKING CODE HERE -->

<?php } ?>

```

But where in WordPress would I add this? Or what file would I edit?

Thank you all!

Nick

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [January 11, 2022, 5:57pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517/2 "2022-01-11T17:57:42Z")

</div>

@Chapster5

How do you have tracking setup now?

@Anton , you still fiddle around with wordpress dev, right? Can you lend a hand here?

---

<div class="post-metadata">

**Author:** ![Chapster5](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Chapster5](https://community.hubspot.com/u/Chapster5)\
**Post date:** [January 11, 2022, 6:02pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517/3 "2022-01-11T18:02:00Z")

</div>

Thank you for the reply @dennisedson

So right now I’m nnot sure as I am trying to help my girlfriend out at her job with their hubspot as its causing a lot of traffic but if a customer goes to a shop page (in this case spare parts for something) they’ve already got the machines in question so dont need sales. So just need that page to be excluded.

I do however have a little test site setup as a demo to play with the test ideas just looking where to insert the code ☺

Nick

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [January 11, 2022, 6:04pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517/4 "2022-01-11T18:04:47Z")

</div>

Before @Anton saves the day, I would suggest checking out the footer.php file 🙂

You can probably piece it together from [this doc](https://knowledge.hubspot.com/reports/install-the-hubspot-tracking-code)

---

<div class="post-metadata">

**Author:** ![Chapster5](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Chapster5](https://community.hubspot.com/u/Chapster5)\
**Post date:** [January 11, 2022, 6:09pm UTC](https://community.hubspot.com/t/excluding-a-page-from-tracking/49517/5 "2022-01-11T18:09:56Z")

</div>

That may be just what I need my friend!

Thank you ❤
