How do I disable long-term stats (but still log daily queries)?


Add the following line to /etc/pihole/pihole-FTL.conf (create this file if it does not exist):


to completely disable the database.

Note that daily logs will still happen unless you have logging turned off. But these will not be saved to the long-term stats database.

How do I delete long-term stats from Pi-hole?

Not working. Did a reboot and can still see the last months.


When you turn off logging, it doesn’t delete the existing database. The information in there remains available.


Why? A value of zero for MAXDBDAYS should delete all data older zero days.
I did not turn of logging. I just need the 24h Dashboard log like in starting days. I cant understand why longterm logging is default on… Its a very big privacy hole. And the main reason for developing pihole was privacy…


I don’t believe that is how the code is written. If this is an undesired result, then perhaps a feature request to change this behavior.

It’s a file that is stored on a password-protected device under your control. To access the file from the web admin dashboard, you need a separate password. What privacy hole does this create?

I believe the main reason was to block advertisements. However, there are a number of privacy options in V4. Web Admin GUI > Settings > Privacy. If you select “paranoia mode”, then “No history is saved at all to the database, and nothing is shown in the query log.”

For the behavior you want (24 hours shown, no long term database), I recommend the following;


sudo service pihole-FTL restart

Delete your existing long term database sudo rm /etc/pihole/pihole-FTL.db

Leave query logging enabled as you have done.


Thats working. Thank you.