Skip to content

Instantly share code, notes, and snippets.

@ewwink
Created May 29, 2018 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewwink/b312f02668ae13d768eb7da9bdea171a to your computer and use it in GitHub Desktop.
Save ewwink/b312f02668ae13d768eb7da9bdea171a to your computer and use it in GitHub Desktop.
Firefox Delete URL History from places.sqlite by days, week, or month
-- open places.sqlite with sqlite2009 or your favorite editor then query:
-- Delete history older than 1 week
DELETE FROM moz_places WHERE datetime(last_visit_date / 1000000, 'unixepoch') < datetime('now', '-7 days')
DELETE FROM moz_historyvisits WHERE datetime(visit_date / 1000000, 'unixepoch') < datetime('now', '-7 days')
-- Delete history older than 1 month
DELETE FROM moz_places WHERE datetime(last_visit_date / 1000000, 'unixepoch') < datetime('now', '-1 month')
DELETE FROM moz_historyvisits WHERE datetime(visit_date / 1000000, 'unixepoch') < datetime('now', '-1 month')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment