<p>There is no way to 'un-import' a private key in the core client. What you could do instead is:</p>

<ol>
<li>Make a list of all the private keys you do care about.</li>
<li>Close your client.</li>
<li>Move the wallet.dat out of the data directory to some other location.</li>
<li>Start the client.</li>
<li>Re-import all the private keys that you do want in your wallet.</li>
</ol>

<p>This is sort of a work around, and it may be kind of tedious, sorry there isn't a better solution currently.</p>

CC BY-SA 3.0
2015-03-09T22:00:08.083Z
Your answer is correct, but I wanted to note that it might be easier in this specific case to use dumpwallet to create a text file of all keys, delete the single key @Valmond doesn't want, move the wallet.dat away, and then use importwallet to import the modified dumpwallet backup.  Because dumpwallet also includes the date each key was first used, this can also save import (rescanning) time.
David A. Harding
CC BY-SA 3.0
2015-03-10T03:06:45.650Z
I often have wondered why it's so cumbersome myself: perhaps the possibility of a lost private key outweighs the convenience factor
Wizard Of Ozzie
CC BY-SA 3.0
2015-03-11T08:16:31.053Z
Thanks, perfect! ps. I bet deleting a private key isn't something people other than developers need to do so it could be risky to have that option.
Valmond
CC BY-SA 3.0
2015-03-09T19:06:57.823Z
2015-09-01T16:57:26.393Z
2015-09-01T16:57:26.393Z
morsecoder
<p>I'm checking out the test net and a friendly person gave me access to his private key so that I didn't need to generate coins, so I importprivkey the key, sent me some coins and...</p>

<p>Well, I understand that now my wallet contains those 2 addresses, how can I remove his address, if possible?</p>

<p>Why do I want to do this? Because I'm testing stuff out and I don't want his transactions / tests cloud mine.</p>

<p>Thanks</p>

<private-key><import>
Can I 'un-import' private key?
Valmond
# Can I 'un-import' private key?

(Asked by: username_0 on 2015-03-09)

I'm checking out the test net and a friendly person gave me access to his private key so that I didn't need to generate coins, so I importprivkey the key, sent me some coins and...

Well, I understand that now my wallet contains those 2 addresses, how can I remove his address, if possible?

Why do I want to do this? Because I'm testing stuff out and I don't want his transactions / tests cloud mine.

Thanks

**Tags:** private-key, import


---

## 1 answers

### Answer by username_1 on 2015-03-09. Score: 4 | Accepted answer

There is no way to 'un-import' a private key in the core client. What you could do instead is:

1. Make a list of all the private keys you do care about.
2. Close your client.
3. Move the wallet.dat out of the data directory to some other location.
4. Start the client.
5. Re-import all the private keys that you do want in your wallet.

This is sort of a work around, and it may be kind of tedious, sorry there isn't a better solution currently.

> **Comments:**
> **username_2**: Your answer is correct, but I wanted to note that it might be easier in this specific case to use dumpwallet to create a text file of all keys, delete the single key @username_0 doesn't want, move the wallet.dat away, and then use importwallet to import the modified dumpwallet backup.  Because dumpwallet also includes the date each key was first used, this can also save import (rescanning) time.  
> **username_3**: I often have wondered why it's so cumbersome myself: perhaps the possibility of a lost private key outweighs the convenience factor  
> **username_0**: Thanks, perfect! ps. I bet deleting a private key isn't something people other than developers need to do so it could be risky to have that option.  

---

