Is there a way to set up Firefox in a way that it absolutely never removes any items from its history (automatically)?

In the past maybe there were a 'keep all history items', then you could set it from menu to a big integer like 999999999 in days.

Since, first unnoticed, this setting was gone, I currently resolved to backing up places.sqlite (on win, in %Appdata%\Mozilla\Firefox\Profiles\<some-profilename>\places.sqlite).

Let's say I won't upgrade without checking that my backup method still works:

How can one today set Firefox v22 to keep all history items?

I've already set these values in about:config.


still I have bookmarks older than the oldest history item in the database; although I cannot recall when I set these settings!

So is this sufficient? Are these good values? Are there other or better ways to do this (eg. an addon).

  • 4
    @Richard I remember doing things far away in the past but cannot recall exact URLs. I recall them longer than these artificial history file&time limit in history. Chances are I haven't bookmarked a site that was of no interest to me then but is of interest now. And I really don't like to start searching for something that I've already found once and found good enough to remember it, as time has told at this point. And I want to keep this data locally, because it's noone else's business.
    – n611x007
    Sep 19, 2013 at 13:56
  • 1
    @cybernard about Evernote, there is no point, I mean I could just use bookmarks, but the problem is that at the time of visiting I cannot foresee the value of the page on the coming days; bookmarks would be easier than taking a note and I do use a lot of bookmarks but here I need exactly the ones that I didn't bookmarked/noted. About entry, you mean the about:config entries? Is it from experience that Firefox respects them? Putting in as much 9s as possible sounds like Cargo Cult and if it's proven ineffective, I will be left empty handed
    – n611x007
    Sep 20, 2013 at 9:47
  • 1
    Since the release of Firefox 4.0.x, the number of days Firefox will retain history for is directly related to system hardware. Firefox calculates how much history to retain without impacting system performance. You can't change it anymore.
    – krowe
    Sep 21, 2013 at 4:59
  • 2
    reference for firefox deleting history based on system: wiki.mozilla.org/Firefox/Projects/Places_async_expiration
    – Achal Dave
    Apr 6, 2014 at 22:12
  • 2
    @AchalDave, I believe that link is about a future project. Whereas current implementation is described at developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Places_Expiration
    – user
    Jan 9, 2015 at 19:45

4 Answers 4


There is now a proper solution (Firefox v40): places.history.expiration.max_pages will override the 'optimal database size' calculations, so setting it to a large positive value should get the desired effect.

See this answer.

  • It's in v4. change blames 30fcd9794eb2 2010-01-15 "part10", bugging 520165 targets mozilla1.9.3a1 refs Places async expiration. closest thing I found in bookmarks is GECKO193a3_20100315_RELBRANCH which was tagged with FIREFOX_4_0b11_RELEASE since 2011-02-03. I confirm 4.0b11 has this logic.
    – n611x007
    Nov 4, 2015 at 9:11
  • so do you think places.history.expiration.max_pages (1) is more effective than places.history.expiration.transient_current_max_pages (2) that I've already set in OP? why? specifically what links const PREF_MAX_URIS = "max_pages"; to (1), but avoids (2)? I shall either confirm that (1) and PEX__loadprefs() is effective or confirm that if I shrink free space to 0, history remains with (1) set but goes with (1) unset.
    – n611x007
    Nov 4, 2015 at 9:18
  • 1
    Good lord that's a terse comment °~° @n611x007: what links PREF_MAX_URIS to (1) is PREF_BRANCH = "places.history.expiration.". max_pages is fetched relative to the .exipration branch — see line 461 and line 760,
    – Cauterite
    Nov 4, 2015 at 9:56
  • 1
    I have reason to believe that setting transient_current_max_pages has no effect on history expiration. nsPlacesExpiration.js never actually reads it, only writes to it as a means of exposing the current history limit for other components to read. places.history.expiration.max_pages is what actually controls expiration.
    – Cauterite
    Nov 4, 2015 at 9:59
  • 1
    @Joel.O did you read /a/895302/995459 ? It says ".max_pages doesn't exist by default, you have to create it" and ".transient_current_max_pages should automatically adjust itself to match your .max_pages setting"
    – Cauterite
    May 1, 2017 at 0:07

You could run a private Firefox Sync server, and set the History retain size to 1 GB, or something insane like that. As far as I know, it will not delete history, and you'll be able to see that entire history on any browser instance you sync.

  • Where do I set the History retain size (in either Firefox or weave-minimal)? I've checked Firefox options/sync but I only saw quota read, and command-line options to weave-minimal but I haven't seen one regarding history retain size.
    – n611x007
    Oct 18, 2013 at 6:50
  • Note: weave-minimal doesn't support the current sync API. You can still run your own instance of the official sync server, but it doesn't have many configurable options — you'd have to patch it to apply a custom history retention policy (I haven't looked any further into it).
    – Cauterite
    Nov 4, 2015 at 11:10

In the palemoon forum from user341084's answer, there was a link to expire-history-by-days add-on - which has an option to disable expiration completely (or define expiration period).

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link answers can become invalid if the linked page changes.
    – CharlieRB
    Jan 9, 2015 at 20:40
  • 1
    I agree - but the link is not to a solution but to a plugin, and the name of the link is the name od the add-on, so there is nothing else i could put here.
    – chukko
    Jan 10, 2015 at 21:33
  • 1
    That option in the add-on simply sets places.history.expiration.max_pages to 999999.
    – user
    Nov 4, 2016 at 8:33

I had the same issue and I discovered a hacky way which you can read about here: http://forum.palemoon.org/viewtopic.php?t=3260

The tl;dr version is, use mozilla.cfg to lock the variable places.history.expiration.transient_current_max_pages to 2147483647 (the largest value accepted). The issue is that Firefox will change that setting automatically unless you lock it.

Note that mozilla.cfg does not work in Portable Firefox, so in such a situation I recommend using Portable Pale Moon instead (which does work with mozilla.cfg)

You can find info on using mozilla.cfg here: http://kb.mozillazine.org/Locking_preferences

This technically doesn't set it to keep history forever, but it'll retain a heck of a lot of entries. I currently have history going back 18 months now and my places.sqlite file (which retains the history) is over 150 MB (6 months ago it was about 100 MB, so for me I add 50MB every 6 months). Note that, with such large sizes, an SSD is HIGHLY recommended. If you don't have one then consider using a ramdisk + symbolic links instead (a ramdisk that saves data at timed intervals or at shutdown).

Also, it may be a good idea to make backups of your history file in case it borks out or something. Then again, it's a good idea to make entire hard drive backups as well...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.