<p>Each wallet has its own <code>wallet.dat</code> file as well as some other files. You can delete a wallet by deleting those files.</p>
<p>First go to the wallets directory. This will either be a folder named <code>wallets</code> inside of the data directory, or the data directory itself (there will not be a folder named <code>wallets</code> in that case). Inside the wallets directory will be folders each named with a wallet's name.</p>
<p>To delete a wallet, delete the folder in the wallets directory with the name of the wallet you want to delete (in this case, <code>help</code>). Note that you must delete the entire directory, leaving the directory there or any of the files it contains will result in errors.</p>

CC BY-SA 4.0
2022-12-27T23:22:25.770Z
Thanks. So I assume there is no rpc to achieve this with `bitcoin-cli`. Any special reason this rpc doesn't exist?
Wieland Gmeiner
CC BY-SA 4.0
2022-12-28T01:52:03.630Z
There is no RPC because we generally do not make it easy for users to delete private keys. This can lead to a loss of funds, so any methods of removing private keys requires doing extra work.
Ava Chow
CC BY-SA 4.0
2024-03-19T22:43:46.313Z
even after removing the wallet directory along with its contents, `bitcoin-cli listwallets` still shows it though :(
papiro
CC BY-SA 4.0
2024-03-20T01:32:38.287Z
@papiro `listwallets` will list wallets that are loaded in memory. You need to have first unloaded the wallet using `unloadwallet`, then you can delete it. Additionally, you should remove it from your bitcoin.conf file if you have specified it there as otherwise the wallet may be recreated the next time you start Bitcoin Core.
Ava Chow
CC BY-SA 4.0
2022-12-27T21:31:17.920Z
2022-12-27T21:31:17.920Z
Ava Chow
<p>I accidentally created a new wallet with</p>
<pre><code>$ bitcoin-cli -testnet createwallet help
{
  &quot;name&quot;: &quot;help&quot;,
  &quot;warning&quot;: &quot;&quot;
}
</code></pre>
<p>Now I would like to delete it without deleting the others I already have, means without deleting the whole wallet.dat. How can I do this?</p>

<bitcoin-core><bitcoind><bitcoin-cli>
How to delete a specific wallet in bitcoind
Wieland Gmeiner
# How to delete a specific wallet in bitcoind

(Asked by: username_0 on 2022-12-27)

I accidentally created a new wallet with

```
$ bitcoin-cli -testnet createwallet help
{
  "name": "help",
  "warning": ""
}

```

Now I would like to delete it without deleting the others I already have, means without deleting the whole wallet.dat. How can I do this?

**Tags:** bitcoin-core, bitcoind, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2022-12-27. Score: 2 | Accepted answer

Each wallet has its own `wallet.dat` file as well as some other files. You can delete a wallet by deleting those files.

First go to the wallets directory. This will either be a folder named `wallets` inside of the data directory, or the data directory itself (there will not be a folder named `wallets` in that case). Inside the wallets directory will be folders each named with a wallet's name.

To delete a wallet, delete the folder in the wallets directory with the name of the wallet you want to delete (in this case, `help`). Note that you must delete the entire directory, leaving the directory there or any of the files it contains will result in errors.

> **Comments:**
> **username_0**: Thanks. So I assume there is no rpc to achieve this with `bitcoin-cli`. Any special reason this rpc doesn't exist?  
> **username_1**: There is no RPC because we generally do not make it easy for users to delete private keys. This can lead to a loss of funds, so any methods of removing private keys requires doing extra work.  
> **username_2**: even after removing the wallet directory along with its contents, `bitcoin-cli listwallets` still shows it though :(  
> **username_1**: @username_2 `listwallets` will list wallets that are loaded in memory. You need to have first unloaded the wallet using `unloadwallet`, then you can delete it. Additionally, you should remove it from your bitcoin.conf file if you have specified it there as otherwise the wallet may be recreated the next time you start Bitcoin Core.  

---

