<p>Tried it here and seems ok. Once you have deleted your field, are you saving your matrix block (top right button)?</p>

<p>If you delete the field then try to recreate it straight away (or any other field for that matter), it gives you the <em>Handle "videoUrl" has already been taken.</em> until you save the block. Once you save, you should be ok to recreate.</p>

<p>It does seem a bit buggy though as you need to save in between each action... Might need to see what the craft guys think.</p>

CC BY-SA 4.0
2019-02-19T11:15:07.667Z
Embed isn't even listed in the admin area as a field handle - but is still treated as one.
Dan Lee
CC BY-SA 4.0
2019-02-19T11:23:31.343Z
Did you leave the page without saving at some point? This might have created the problem. Do you see the field in the Db?
Oli
CC BY-SA 4.0
2019-02-19T11:25:05.980Z
Very possible - I'm taking a look now in the DB.
Dan Lee
CC BY-SA 4.0
2019-02-19T11:26:50.260Z
I have tried deleting a field from a block in the Db just now and it doesn't seem to cause problem so you should be safe to do that. Back up before in case... :)
Oli
CC BY-SA 4.0
2019-02-19T11:27:05.670Z
Yes it is still there
Dan Lee
CC BY-SA 4.0
2019-02-19T11:27:34.323Z
I'd say back up and delete to see...
Oli
CC BY-SA 4.0
2019-02-19T11:05:05.843Z
2019-02-19T11:05:05.843Z
Oli
<p>So I used the following to find unused fields in the database. Then I manually removed them. Please backup before doing this!</p>

<pre><code>SELECT f.* FROM fields f LEFT JOIN fieldlayoutfields l ON l.fieldId = f.id WHERE l.id IS NULL
</code></pre>

CC BY-SA 4.0
2019-02-19T11:54:13.670Z
2019-02-19T11:54:13.670Z
Dan Lee
<p>I'm working with Matrix field. When adding and then removing and then adding again fields with the same handle I get the following error.</p>

<p><em>Handle "videoUrl" has already been taken.</em></p>

<p>Is there a way of removing old handles that are not being used?</p>

<p>This is actually creating issues adding new fields with a different handle too. Even though a new handle is being used an old handle is being referenced as a blocker to adding a new field. I get the following error when trying to save a post.</p>

<p><strong><em>Invalid field handle: embed</em></strong></p>

<p>'Embed' isn't even listed in the field manager area as a field handle but the problem persists.</p>

<craft3><matrix>
Removing old Block Handles in Matrix Field?
# Removing old Block Handles in Matrix Field?

(Asked by: username_0 on 2019-02-19)

I'm working with Matrix field. When adding and then removing and then adding again fields with the same handle I get the following error.

*Handle "videoUrl" has already been taken.*

Is there a way of removing old handles that are not being used?

This is actually creating issues adding new fields with a different handle too. Even though a new handle is being used an old handle is being referenced as a blocker to adding a new field. I get the following error when trying to save a post.

***Invalid field handle: embed***

'Embed' isn't even listed in the field manager area as a field handle but the problem persists.

**Tags:** craft3, matrix


---

## 2 answers

### Answer by username_1 on 2019-02-19. Score: 1

Tried it here and seems ok. Once you have deleted your field, are you saving your matrix block (top right button)?

If you delete the field then try to recreate it straight away (or any other field for that matter), it gives you the *Handle "videoUrl" has already been taken.* until you save the block. Once you save, you should be ok to recreate.

It does seem a bit buggy though as you need to save in between each action... Might need to see what the craft guys think.

> **Comments:**
> **username_0**: Embed isn't even listed in the admin area as a field handle - but is still treated as one.  
> **username_1**: Did you leave the page without saving at some point? This might have created the problem. Do you see the field in the Db?  
> **username_0**: Very possible - I'm taking a look now in the DB.  
> **username_1**: I have tried deleting a field from a block in the Db just now and it doesn't seem to cause problem so you should be safe to do that. Back up before in case... :)  
> **username_0**: Yes it is still there  
> **username_1**: I'd say back up and delete to see...  

---

### Answer by username_0 on 2019-02-19. Score: 0

So I used the following to find unused fields in the database. Then I manually removed them. Please backup before doing this!
SELECT f.* FROM fields f LEFT JOIN fieldlayoutfields l ON l.fieldId = f.id WHERE l.id IS NULL


---

