Sunday 15 January 2023

How to delete google chrome history and cookies older than a date?


Why do we want to delete history and cookies? Apart from privacy reasons, definitely it is to increase free space on your drive, and to speed up the browser. First of all, let us see, why do we need this method. Chrome already enables you to delete history and cookies for the last hour, last 24 hours, last week, and last month. It also provides you to delete the entire history too. But unfortunately, it is not possible to delete history older than a date.

Note that, deleting entire history and cookies, is not a good option, as you will be logged-off, from all the websites, and you would have to login again. What we actually require, is to clean up the older history, for example, those before 2 months. That is what we really need to do regularly, to keep the system clean and speedy. 

  • First, locate the cookies and history database files, for chrome. In windows, the cookies file would be in %localappdata%\Google\chrome\user data\default\network. The history file would be in %localappdata%\Google\chrome\user data\default
  • Download DB browser for SQL-Lite from https://sqlitebrowser.org/. The portable zip version is enough. Unzip the file and run. 
  • Close the chrome browser if it is open. Open the cookies DB file. Browse Cookies table. Right-click the column header of the column last_access_utc, edit display format, and substitute this code. datetime(("last_access_utc" / 1000000) -11644473600, 'unixepoch', 'localtime') Sort newer to older. Hide unwanted columns. Scroll down till the desired cut off date, select all the entries below, and delete. Remember to click write changes.
  • Repeat the same, for history DB file also. Browse, the urls table. The column in this case is last_visit_time, and the code also differs accordingly. Right-click the column header of the column, edit display format, and substitute this code. datetime(("last_visit_time" / 1000000) -11644473600, 'unixepoch', 'localtime') Sort newer to older. Hide unwanted columns. Scroll down till the desired cut-off date, select all the entries below, and delete. Remember to click write changes.
  • If needed, this can be saved as a project, so that this view would be preserved. Also, you can make DB browser the default application to open these project files on a click.

0 comments:

Post a Comment

 
Back to top!