Remove large amount of items from blacklist

Expected Behaviour:

Ideally, i'd be able to remove a large amount of entries into the blacklist of Pi-Hole in one go (as if you would select and delete the relevant lines from a txt file, for instance).

Actual Behaviour:

Each line needs to be manually removed in the Pi-Hole interface (bit of an issue as there are 20k+)

You have 20K+ domains in your blacklist? That seems a lot. May I ask why so many?

Ran a script that added known youtube add domains, you know ones like r13---sn--cxaaj5o5q5-tt16.googlevideo.com - just an example - which actually also can be added in regex-format or via an adlist...

Only saw the error of my ways when it had already happened...

Is this a feature request or are you seeking help?
Are there specific entries you want to delete or just all?

If you want to delete all exact blacklist entries, this command will do it. If you want to just delete a subset, then you will need to add additional criteria to the command:

sudo sqlite3 /etc/pihole/gravity.db "delete from domainlist where type=1;"

1 Like

Well, it is mainly a request for help (but could see this also making sense as a feature come to think of it).
Ideally, I'd only deleted the specific ones that are linked to googlevideos...

sudo sqlite3 /etc/pihole/gravity.db "delete from domainlist where type=1 AND domain like '%googlevideo%' ;"

This works - thanks @jfb !

1 Like

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