Home » Questions » Computers [ Ask a new question ]

How can I delete everything in my Firefox history older than N days?

How can I delete everything in my Firefox history older than N days?

I set FireFox to store my history for 90 days, and I think this is slowing down the AwesomeBar. I set it to store history for 45 days, but I don't know how to delete everything in my existing history older than 45 days.

Asked by: Guest | Views: 353
Total answers/comments: 3
Guest [Entry]

You can try out the Expire history by days extension.
Guest [Entry]

Just wait 24 hours! or you could close the browser (without saving tabs to cache (bookmark all tabs if required)) and then open it and and see if that worked.
Guest [Entry]

"The following fast bash script has been working well on my OS X 10.6.8 after I updated /usr/bin/sqlite3. Hopefully it will work on most versions of OS X and Linux.

d=30; # Number of days of history to keep
find ~ \( -ipath *Mozilla/Firefox*/places.sqlite -or -ipath *Support/Firefox*/places.sqlite \) > ~/.firefox-places;
x=""$(<~/.firefox-places)""; # List of locations of Firefox places.sqlite - may not use 'find' every time in future
cd ""${x%%places.sqlite*}""; # For the time being select only the first places.sqlite location - may change later
t=$(date -v-""$d""d +%s)000000; # Fast Moz compatible time for 'd' days ago - note the 'multiply' by 1,000,000
sudo echo ""delete from moz_historyvisits where visit_date < $t; vacuum;"" | sqlite3 places.sqlite;

Please don't wrap the above script to improve the display here."