# Can I remove a specific domain from the logs?

**URL:** <https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384>\
**Category:** Help\
**Created:** [March 13, 2020, 4:40pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384 "2020-03-13T16:40:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lefixi](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/l/d2c977/32.png) [@lefixi](https://discourse.pi-hole.net/u/lefixi)\
**Post date:** [March 13, 2020, 4:40pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/1 "2020-03-13T16:40:10Z")

</div>

For example I want to remove google.com from the logs.  
Is there a way to delete it from the database?  
Also if I remove a device from the network table will it delete all it's logged domains?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [March 13, 2020, 5:32pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/2 "2020-03-13T17:32:56Z")

</div>

> [@lefixi](#):
>
> For example I want to remove google.com from the logs.  
> Is there a way to delete it from the database?

Not via the Pi-hole web GUI. You can use SQL database commands to purge this from the database.

> [@lefixi](#):
>
> if I remove a device from the network table will it delete all it’s logged domains?

No.

---

<div class="post-metadata">

**Author:** ![lefixi](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/l/d2c977/32.png) [@lefixi](https://discourse.pi-hole.net/u/lefixi)\
**Post date:** [March 13, 2020, 5:50pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/3 "2020-03-13T17:50:15Z")

</div>

Hey, thanks for answering. I did delete them from the logs with  
`sqlite3 /etc/pihole/pihole-FTL.db "DELETE FROM queries WHERE domain='example.com';"`

But I still have one more problem. It did not change the number of queries in the network tab. Is there a way to reflect the changes and get the new lower number after I deleted the queries?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [March 13, 2020, 7:25pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/4 "2020-03-13T19:25:28Z")

</div>

I think you will need to delete the entire entry in the database for each of those queries. But, I have not done this so can only surmise.

_ **Edit - this is incorrect** _. See further comments below.

---

<div class="post-metadata">

**Author:** ![lefixi](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/l/d2c977/32.png) [@lefixi](https://discourse.pi-hole.net/u/lefixi)\
**Post date:** [March 13, 2020, 7:46pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/5 "2020-03-13T19:46:00Z")

</div>

What do you mean 'entire entry'? Doesn't the SQL command I posted above do exactly that?

---

<div class="post-metadata">

**Author:** ![DL6ER](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dl6er/32/281_2.png) [@DL6ER](https://discourse.pi-hole.net/u/DL6ER)\
**Post date:** [March 13, 2020, 8:20pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/6 "2020-03-13T20:20:41Z")

</div>

> [@lefixi](#):
>
> Doesn’t the SQL command I posted above do exactly that?

Yes, it is sufficient. @jfb SQLite3 always operates on whole database rows. `DELETE FROM queries` with `WHERE domain='blah'` will remove all entire lines under the given constraint.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [April 3, 2020, 8:25pm UTC](https://discourse.pi-hole.net/t/can-i-remove-a-specific-domain-from-the-logs/29384/7 "2020-04-03T20:25:30Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
