[GNC] Deleting old entries

Ken Pyzik pyz01 at outlook.com
Mon Mar 23 19:38:55 EDT 2026


OK - this has been discussed many times.  Several people will recommend 
you NOT to do it.  Others will tell you it is possible, but not 
advisable.  Finally, there are others, like me, who will say this it is 
doable, a little cumbersome, but it can be done and you can have exactly 
what you want.  BUT - only you can decide if it is worth it.

Please read this whole e-mail before attempting it!  Also, in the second 
part of this e-mail is a keyboard shortcut to help delete multiple 
entries quickly.   First - a few questions you need to answer for 
yourself:

1 - How comfortable are you with the system?  Do you feel you have a 
good comfort level with understanding the affect of removing old 
transactions (i.e., for every transaction you remove, you are actually 
removing a single transaction from two accounts - one transaction from 
each affected account)?  If you have a clear understanding of how this 
works - you will be in good shape.

2.  - Do you know what you want for your "starting state"?  What I mean 
by that is this:  If you want all transactions for the last two years, 
what is the date you want this to start - 1/1/2025 or a different date?  
This is important because you need to know what the balances "were" on 
that starting date.  You need to jot down what those balances are - 
because that will be your starting balances for your new file.

3- Finally, what is the scope of this (i.e., do I have a few hundred 
transactions to get rid of or multiple tens of thousands to get rid of)? 
  This will help you decide if you want to do this.

Once you know the answers to these three pieces, the rest is simply 
mechanics.  Make TWO copies of your current file.  Once you do this you 
are ready to begin.

Start with copy one.  Jot down the balances of all your accounts as of 
today.  Now go delete all transactions prior to the start date.  You now 
have a file with the last two years of transactions (or all transactions 
for your "start date").   Enter the beginning balances for each account 
that it was on the start date.  The file should now be you balances as 
of today.  You have your file.  Name it current file.

If all is well - you are basically done.  However, if you want history 
of your old transactions, open file copy two.  In this file, delete all 
transaction AFTER your start date.  Make sure the balances are what you 
believe they should be.  If they are, you now have a file will all 
transactions from beginning up until your "start date" of you new file.  
Call this file history file year xx - year xx.

Now, let's assume you did all of this and it all mucked up (which it 
could be).  Delete copy one and two.  Make two new copies of your 
current file and try again.  Sooner or later, you should get to where 
you want to be.

Let me know if this makes sense.

IMPORTANT NOTE & CAVEAT - if you have only a few hundred transactions to 
delete, this process can be fairly easy.  I did it in 10 minutes. 
HOWEVER - if you have several thousand transactions or tens of thousands 
of transactions to delete, this process may not be worth it.  Only you 
can make that determination.

Last note:  If you want to attempt this - this is one REAL key item 
below that can help tremendously.  BELOW is an e-mail I sent about 7 
years ago:

For me I made a copy of my current file.  Then on the copy I wanted to 
delete any transaction after 1/1/2018.  This file now become an archive
file.  Now re-open my current file.  Delete any transactions in it prior 
to 1/1/2018.  Before deleting, make note of account balance amounts so I 
can
make sure I am balanced once I delete.  Enter new "Opening balance 
amounts" as needed to ensure balances are current and balanced.  Now I 
have a file with just the last 2 years transaction.   Did a search on 
the net and found this:

" I made a shortcut key for deleting transactions. I modified the 
C:\Users\username\.gnu-cash\accelerator-map file (with gnucash closed)
by changing the line

; (gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" "")

To:

(gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" 
"<Primary>Delete")

Now I could delete transactions by pressing ctrl+delete. Pressing and 
holding this key combination allowed continuous deleting at a 
predictable
rate so it was quite easy to delete a few hundred transactions quickly.  
Might not be the best solution if you have many thousands of 
transactions
that you want to delete but for a few hundred it was quite painless. As 
a follow-up to this very useful info, on a Windows PC, the file is
located in:

C:\Users\UserName\AppData\Roaming\GnuCash\accelerator-map

The way the edited line is displayed in the above answer is correct but 
it may not be immediately obvious to everyone that like some other 
languages, the semicolon needs to be removed as well. The semicolon is a 
comment tag that disables the line it is on.

Notes:

<Primary> is the same as "Command" on macs and "Ctrl" on Windows. Other 
modifiers are <Shift> and <Alt> and they can be combined so to make it a 
bit more difficult to do accidentally, my new line is:

(gtk_accel_path
"<Actions>/GncPluginPageRegisterActions/DeleteTransactionAction" 
"<Primary><Shift>Delete")

AKA: Control + Shift + Delete

This works in version 3.6 (and also works in  version 4 and 5) of 
Gnucash - and I am using it in Windows.  If you need or want to delete 
multiple transactions - this is very handy.  Thanks to all.

Ken


------ Original Message ------
>From "Joseph Hesse" <joe.hesse at actcx.com>
To "GNU Cash" <gnucash-user at gnucash.org>
Date 3/23/2026 9:21:26 AM
Subject [GNC] Deleting old entries

>My gnucash data is about 7 years old.  I only want the last two years worth of data.  Is there an orderly way of removing old entries?
>
>
>_______________________________________________
>gnucash-user mailing list
>gnucash-user at gnucash.org
>To update your subscription preferences or to unsubscribe:
>https://lists.gnucash.org/mailman/listinfo/gnucash-user
>-----
>Please remember to CC this list on all your replies.
>You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list